From 767badbfb9bd36017eaf56f7f91f16bcb970d4ea Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Sun, 4 May 2014 15:13:25 -0600 Subject: [PATCH] Magic number reduction: Clothing flags Bone and shell are used to construct BARRED and SCALED armor/clothing items, for some reason. --- plugins/lua/stockflow.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/lua/stockflow.lua b/plugins/lua/stockflow.lua index 6e893a660..a9390bef7 100644 --- a/plugins/lua/stockflow.lua +++ b/plugins/lua/stockflow.lua @@ -703,8 +703,8 @@ function collect_reactions() end -- BARRED and SCALED as flag names don't quite seem to fit, here. - clothing_reactions(result, materials.bone, (function(itemdef) return itemdef.props.flags[3] end)) - clothing_reactions(result, materials.shell, (function(itemdef) return itemdef.props.flags[4] end)) + clothing_reactions(result, materials.bone, (function(itemdef) return itemdef.props.flags.BARRED end)) + clothing_reactions(result, materials.shell, (function(itemdef) return itemdef.props.flags.SCALED end)) for _, mat in ipairs{materials.wood, materials.leather} do resource_reactions(result, job_types.MakeShield, mat, entity.resources.shield_type, itemdefs.shields, {})