From 99f636fc903581baee5c593d9b69aa4117c106b6 Mon Sep 17 00:00:00 2001 From: MrFreeman Date: Sat, 29 Oct 2022 11:46:39 +0200 Subject: [PATCH] Modified the HUD remove function: fixed the check if player has the HUD or not --- minigame_manager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minigame_manager.lua b/minigame_manager.lua index 51a9648..8079561 100644 --- a/minigame_manager.lua +++ b/minigame_manager.lua @@ -21,7 +21,7 @@ end local function sumo_remove_controls_hud(p_name) player = minetest.get_player_by_name(p_name) if not player then return end - if huds[p_name] then + if huds[p_name] ~= nil then player:hud_remove(huds[p_name].controls) huds[p_name].controls = nil end @@ -318,7 +318,7 @@ end) arena_lib.on_quit('sumo', function(arena, pl_name, is_forced) local player = minetest.get_player_by_name(pl_name) - if player then + if player and huds[pl_name].controls ~= nil then sumo_remove_controls_hud(pl_name) arena_lib.HUD_hide('hotbar', pl_name) end