From 5409f33f24fb82675f88c19690928a2f107a4e02 Mon Sep 17 00:00:00 2001 From: Minetest-j45 <55553015+Minetest-j45@users.noreply.github.com> Date: Sun, 7 Mar 2021 19:09:36 +0000 Subject: [PATCH] Remove combat HUDs at start of new match (#822) * Remove coward HUD on new game * Update init.lua Co-authored-by: LoneWolfHT --- mods/pvp/anticoward/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mods/pvp/anticoward/init.lua b/mods/pvp/anticoward/init.lua index cfa55c0..bba05b5 100644 --- a/mods/pvp/anticoward/init.lua +++ b/mods/pvp/anticoward/init.lua @@ -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)