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:
Minetest-j45 2021-03-07 19:09:36 +00:00 committed by GitHub
parent da3d7487f6
commit 5409f33f24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,9 +165,23 @@ minetest.register_globalstep(function(dtime)
end)
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 = {}
end)
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 = {}
end)