Remove combat HUDs at start of new match (#822)
* Remove coward HUD on new game * Update init.lua Co-authored-by: LoneWolfHT <lonewolf04361@gmail.com>
This commit is contained in:
parent
da3d7487f6
commit
5409f33f24
1 changed files with 14 additions and 0 deletions
|
@ -165,9 +165,23 @@ minetest.register_globalstep(function(dtime)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ctf_match.register_on_new_match(function()
|
ctf_match.register_on_new_match(function()
|
||||||
|
for coward, info in pairs(potential_cowards) do
|
||||||
|
coward = minetest.get_player_by_name(coward)
|
||||||
|
|
||||||
|
if coward and info.hud then
|
||||||
|
coward:hud_remove(info.hud)
|
||||||
|
end
|
||||||
|
end
|
||||||
potential_cowards = {}
|
potential_cowards = {}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
ctf.register_on_new_game(function()
|
ctf.register_on_new_game(function()
|
||||||
|
for coward, info in pairs(potential_cowards) do
|
||||||
|
coward = minetest.get_player_by_name(coward)
|
||||||
|
|
||||||
|
if coward and info.hud then
|
||||||
|
coward:hud_remove(info.hud)
|
||||||
|
end
|
||||||
|
end
|
||||||
potential_cowards = {}
|
potential_cowards = {}
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in a new issue