From d6bbb6808b5705aa1b3344961b3eb155797eef9e Mon Sep 17 00:00:00 2001 From: expwnent Date: Thu, 3 Jul 2014 14:38:29 -0400 Subject: [PATCH] item-trigger tweaks. --- scripts/modtools/item-trigger.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/modtools/item-trigger.lua b/scripts/modtools/item-trigger.lua index 1d505e7eb..8fd5e88bb 100644 --- a/scripts/modtools/item-trigger.lua +++ b/scripts/modtools/item-trigger.lua @@ -173,21 +173,21 @@ if not args.command then return end -if args.weaponType then +if args.itemType then local temp - for _,itemdef in ipairs(df.global.world.raws.itemdefs.weapons) do - if itemdef.id == args.weaponType then + for _,itemdef in ipairs(df.global.world.raws.itemdefs.all) do + if itemdef.id == args.itemType then temp = itemdef.subtype break end end if not temp then - error 'Could not find weapon type.' + error 'Could not find item type.' end - args.weaponType = temp + args.itemType = temp end -local numConditions = (args.material and 1 or 0) + (args.weaponType and 1 or 0) + (args.contaminant and 1 or 0) +local numConditions = (args.material and 1 or 0) + (args.itemType and 1 or 0) + (args.contaminant and 1 or 0) if numConditions > 1 then error 'too many conditions defined: not (yet) supported (pester expwnent if you want it)' elseif numConditions == 0 then