Fix crash / luacheck warning caused by armor with thorns level > 10

This commit is contained in:
Elias Fleckenstein 2021-05-26 20:51:39 +02:00
parent 079cedaa34
commit 772f48ed58

View File

@ -68,7 +68,7 @@ mcl_damage.register_modifier(function(obj, damage, reason)
if do_irregular_damage or thorns_damage_regular < 4 and math.random() < enchantments.thorns * 0.15 then if do_irregular_damage or thorns_damage_regular < 4 and math.random() < enchantments.thorns * 0.15 then
if do_irregular_damage then if do_irregular_damage then
thorns_damage_irregular = thorns_damage_irregular + throrns_level - 10 thorns_damage_irregular = thorns_damage_irregular + enchantments.thorns - 10
else else
thorns_damage_regular = math.min(4, thorns_damage_regular + math.random(4)) thorns_damage_regular = math.min(4, thorns_damage_regular + math.random(4))
end end