Fix registered group level display

This commit is contained in:
stujones11 2018-01-10 19:16:23 +00:00
parent 291b34bfc6
commit 4fc51971d1

@ -218,6 +218,7 @@ armor.set_player_armor = function(self, player)
local level = def.groups["armor_"..element] local level = def.groups["armor_"..element]
levels["fleshy"] = levels["fleshy"] + level levels["fleshy"] = levels["fleshy"] + level
end end
break
end end
-- DEPRECATED, use armor_groups instead -- DEPRECATED, use armor_groups instead
if def.groups["armor_radiation"] and levels["radiation"] then if def.groups["armor_radiation"] and levels["radiation"] then
@ -419,8 +420,9 @@ armor.get_armor_formspec = function(self, name, listring)
for _, attr in pairs(self.attributes) do for _, attr in pairs(self.attributes) do
formspec = formspec:gsub("armor_attr_"..attr, armor.def[name][attr]) formspec = formspec:gsub("armor_attr_"..attr, armor.def[name][attr])
end end
for _, group in pairs(self.attributes) do for group, _ in pairs(self.registered_groups) do
formspec = formspec:gsub("armor_group_"..group, armor.def[name][group]) formspec = formspec:gsub("armor_group_"..group,
armor.def[name].groups[group])
end end
return formspec return formspec
end end