Fix respawn immunity ending when hitting teammate (#742)
This commit is contained in:
parent
62cedd9267
commit
ec36999fa3
1 changed files with 12 additions and 10 deletions
|
@ -45,7 +45,8 @@ minetest.register_on_punchplayer(function(player, hitter,
|
||||||
local pteam = ctf.player(pname).team
|
local pteam = ctf.player(pname).team
|
||||||
local hteam = ctf.player(hname).team
|
local hteam = ctf.player(hname).team
|
||||||
|
|
||||||
if player and ctf_respawn_immunity.is_immune(player) and pteam ~= hteam then
|
if pteam ~= hteam then
|
||||||
|
if player and ctf_respawn_immunity.is_immune(player) then
|
||||||
minetest.chat_send_player(hname, minetest.colorize("#EE8822", pname ..
|
minetest.chat_send_player(hname, minetest.colorize("#EE8822", pname ..
|
||||||
" just respawned or joined," .. " and is immune to attacks!"))
|
" just respawned or joined," .. " and is immune to attacks!"))
|
||||||
return true
|
return true
|
||||||
|
@ -57,6 +58,7 @@ minetest.register_on_punchplayer(function(player, hitter,
|
||||||
immune_players[hname] = nil
|
immune_players[hname] = nil
|
||||||
ctf_respawn_immunity.update_effects(hitter)
|
ctf_respawn_immunity.update_effects(hitter)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_joinplayer(ctf_respawn_immunity.set_immune)
|
minetest.register_on_joinplayer(ctf_respawn_immunity.set_immune)
|
||||||
|
|
Loading…
Reference in a new issue