Modified the HUD remove function: fixed the check if player has the HUD or not

This commit is contained in:
MrFreeman 2022-10-29 11:46:39 +02:00
parent 1ceef26e35
commit 99f636fc90

View File

@ -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