From 4b327bcf99338a28ec505289cbafcbb9f74b25dc Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 5 May 2021 14:41:23 +0200 Subject: [PATCH] Minor fix to prevent writing the damage reason approval field into MCL damage reason and calling passive damage handlers on dead players --- mods/CORE/mcl_damage/init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/CORE/mcl_damage/init.lua b/mods/CORE/mcl_damage/init.lua index df2ecd58dc..8b2acbb355 100644 --- a/mods/CORE/mcl_damage/init.lua +++ b/mods/CORE/mcl_damage/init.lua @@ -149,16 +149,16 @@ minetest.register_on_player_hpchange(function(player, hp_change, mt_reason) end, true) minetest.register_on_player_hpchange(function(player, hp_change, mt_reason) - if hp_change < 0 then - mcl_damage.run_damage_callbacks(player, -hp_change, mcl_damage.from_mt(mt_reason)) - end if player:get_hp() > 0 then - mt_reason._mcl_approved = true + mt_reason.approved = true + if hp_change < 0 then + mcl_damage.run_damage_callbacks(player, -hp_change, mcl_damage.from_mt(mt_reason)) + end end end, false) 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)) end end)