nuclear_reactor: do not set structure_accumulated_badness to less than 0

This commit is contained in:
DS 2017-09-07 07:43:20 +02:00 committed by Nathanaël Courant
parent a84b5f3b28
commit e056800cea

@ -257,7 +257,7 @@ minetest.register_abm({
local accum_badness = meta:get_int("structure_accumulated_badness") local accum_badness = meta:get_int("structure_accumulated_badness")
if badness == 0 then if badness == 0 then
if accum_badness ~= 0 then if accum_badness ~= 0 then
meta:set_int("structure_accumulated_badness", accum_badness - 4) meta:set_int("structure_accumulated_badness", math.max(accum_badness - 4, 0))
siren_clear(pos, meta) siren_clear(pos, meta)
end end
else else