From abb59416169356d07e2a96333cddafd012fb437c Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 8 Jul 2020 17:31:08 -0400 Subject: [PATCH] Update drowning logic for lava and fireproof (still commented out) --- mods/ITEMS/mcl_potions/functions.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 3dfdac5dee..7b737dc199 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -263,7 +263,7 @@ local is_fire_node = { ["mcl_core:lava_flowing"]=true, -- Prevent damage to player with Fire Resistance enabled -minetest.register_on_player_hpchange(function(player, hp_change) +minetest.register_on_player_hpchange(function(player, hp_change, reason) if is_fire_proof[player] and hp_change < 0 then -- This is a bit forced, but it assumes damage is taken by fire and avoids it @@ -271,12 +271,10 @@ minetest.register_on_player_hpchange(function(player, hp_change) -- it's worth noting that you don't take damage from players in this case... local player_info = mcl_playerinfo[player:get_player_name()] + -- if reason.type == "drown" then return hp_change + if is_fire_node[player_info.node_head] or is_fire_node[player_info.node_feet] or is_fire_node[player_info.node_stand] then - -- if player:get_breath() == 0 and hp_change == -4 then -- probably drowning - -- return hp_change - -- else - return 0 - -- end + return 0 else return hp_change end