1
0
Fork 0

Minor fix to prevent writing the damage reason approval field into MCL damage reason and calling passive damage handlers on dead players

This commit is contained in:
Lizzy Fleckenstein 2021-05-05 14:41:23 +02:00
parent 35a2a2b912
commit 4b327bcf99
1 changed files with 5 additions and 5 deletions

View File

@ -149,16 +149,16 @@ minetest.register_on_player_hpchange(function(player, hp_change, mt_reason)
end, true) end, true)
minetest.register_on_player_hpchange(function(player, hp_change, mt_reason) minetest.register_on_player_hpchange(function(player, hp_change, mt_reason)
if player:get_hp() > 0 then
mt_reason.approved = true
if hp_change < 0 then if hp_change < 0 then
mcl_damage.run_damage_callbacks(player, -hp_change, mcl_damage.from_mt(mt_reason)) mcl_damage.run_damage_callbacks(player, -hp_change, mcl_damage.from_mt(mt_reason))
end end
if player:get_hp() > 0 then
mt_reason._mcl_approved = true
end end
end, false) end, false)
minetest.register_on_dieplayer(function(player, mt_reason) minetest.register_on_dieplayer(function(player, mt_reason)
if mt_reason._mcl_approved then if mt_reason.approved then
mcl_damage.run_death_callbacks(player, mcl_damage.from_mt(mt_reason)) mcl_damage.run_death_callbacks(player, mcl_damage.from_mt(mt_reason))
end end
end) end)