From 1ceef26e350ea796ee31b7a40002c47bf89997e0 Mon Sep 17 00:00:00 2001 From: MrFreeman Date: Fri, 28 Oct 2022 21:11:44 +0200 Subject: [PATCH] Added if condition to if player has the HUD before to remove it --- minigame_manager.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/minigame_manager.lua b/minigame_manager.lua index 0725f3a..51a9648 100644 --- a/minigame_manager.lua +++ b/minigame_manager.lua @@ -21,8 +21,10 @@ end local function sumo_remove_controls_hud(p_name) player = minetest.get_player_by_name(p_name) if not player then return end - player:hud_remove(huds[p_name].controls) - -- huds[p_name].controls = nil + if huds[p_name] then + player:hud_remove(huds[p_name].controls) + huds[p_name].controls = nil + end end local function sumo_set_attribute_lives(arena, pl_name)