mirror of
https://github.com/minetest-mods/technic.git
synced 2024-08-20 21:44:14 +02:00
Apply radiation damage only if entity is not dead (#504)
This prevents on_dieplayer being called unnecessarily, causing problems such as repeated death messages.
This commit is contained in:
parent
62fdb853ec
commit
dc4f4f66e6
@ -338,7 +338,7 @@ local function dmg_abm(pos, node)
|
|||||||
local max_dist = strength * rad_dmg_mult_sqrt
|
local max_dist = strength * rad_dmg_mult_sqrt
|
||||||
for _, o in pairs(minetest.get_objects_inside_radius(pos,
|
for _, o in pairs(minetest.get_objects_inside_radius(pos,
|
||||||
max_dist + abdomen_offset)) do
|
max_dist + abdomen_offset)) do
|
||||||
if entity_damage or o:is_player() then
|
if (entity_damage or o:is_player()) and o:get_hp() > 0 then
|
||||||
dmg_object(pos, o, strength)
|
dmg_object(pos, o, strength)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user