From e908ed8563bb2eb29ed6eebf2dfdaa80550b2774 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Wed, 24 Apr 2024 08:43:31 -0700 Subject: [PATCH] Update builtin/game/hud.lua Co-authored-by: grorp --- builtin/game/hud.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/game/hud.lua b/builtin/game/hud.lua index dc7101caa..1bc4b48d7 100644 --- a/builtin/game/hud.lua +++ b/builtin/game/hud.lua @@ -224,10 +224,10 @@ register_builtin_hud_element("breath", { -- The breathbar stays for some time and then gets removed. breathbar_removal_jobs[player_name] = core.after(1, function() local player = core.get_player_by_name(player_name) - local id = hud_ids[player_name] - if player and id and id.breath then - player:hud_remove(id.breath) - hud_ids[player_name].breath = nil + local player_hud_ids = hud_ids[player_name] + if player and player_hud_ids and player_hud_ids.breath then + player:hud_remove(player_hud_ids.breath) + player_hud_ids.breath = nil end breathbar_removal_jobs[player_name] = nil end)