Skip to content

Commit

Permalink
Fix issues with unbreakable node damage
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Jun 18, 2024
1 parent e5c4f92 commit 9ec18bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mods/ctf/ctf_map/nodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9ec18bc

Please sign in to comment.