convert index

develop
Myk Taylor 2023-02-08 14:01:38 -08:00
parent 5c84d18001
commit 4d4e94c449
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 5 additions and 6 deletions

@ -15,7 +15,7 @@ local function process_args(opts, args)
end
function status()
print(('tailor is %s'):format(enabled and "enabled" or "disabled"))
print(('tailor is %s'):format(isEnabled() and "enabled" or "disabled"))
print('materials preference order:')
for _,name in ipairs(tailor_getMaterialPreferences()) do
print((' %s'):format(name))

@ -3,7 +3,6 @@
*/
#include <string>
#include <unordered_map>
#include <vector>
#include "df/creature_raw.h"
@ -695,10 +694,10 @@ static void tailor_setMaterialPreferences(color_ostream &out, int32_t silkIdx,
// it doesn't really matter if these are invalid. set_material_order will do
// the right thing.
set_config_val(config, CONFIG_SILK_IDX, silkIdx);
set_config_val(config, CONFIG_CLOTH_IDX, clothIdx);
set_config_val(config, CONFIG_YARN_IDX, yarnIdx);
set_config_val(config, CONFIG_LEATHER_IDX, leatherIdx);
set_config_val(config, CONFIG_SILK_IDX, silkIdx - 1);
set_config_val(config, CONFIG_CLOTH_IDX, clothIdx - 1);
set_config_val(config, CONFIG_YARN_IDX, yarnIdx - 1);
set_config_val(config, CONFIG_LEATHER_IDX, leatherIdx - 1);
set_material_order();
}