From 9ec18bc2f178cb094933ddefa9900c3ccf11939e Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Tue, 18 Jun 2024 12:32:44 -0700 Subject: [PATCH] Fix issues with unbreakable node damage --- mods/ctf/ctf_map/nodes.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ctf/ctf_map/nodes.lua b/mods/ctf/ctf_map/nodes.lua index 3ce73c27e6..f85dba4e0b 100644 --- a/mods/ctf/ctf_map/nodes.lua +++ b/mods/ctf/ctf_map/nodes.lua @@ -128,7 +128,9 @@ end minetest.register_on_player_hpchange(function(player, hp_change, reason) local pos = player:get_pos() - if reason.type == 'node_damage' and minetest.registered_nodes[reason.node].groups.immortal then + local def = minetest.registered_nodes[reason.node] + + if reason.type == 'node_damage' and def.groups.immortal and def.drawtype == "normal" and def.walkable ~= false then for _, flagteam in ipairs(ctf_teams.current_team_list) do if flagteam ~= ctf_teams.get(player) then local fdist = vector.distance(pos, ctf_map.current_map.teams[flagteam].flag_pos)