Skip to content

Commit

Permalink
Fix very rare crash
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Jan 4, 2024
1 parent 603572b commit 500a3cc
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions mods/apis/hud_events/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,24 @@ local function handle_hud_events(player)
end

hud_queues[pname].t = minetest.after(HUD_SHOW_TIME, function()
hud:change(player, "hud_event", {text = ""})

hud_queues[pname].t = minetest.after(HUD_SHOW_NEXT_TIME, function()
if #hud_queues[pname].e >= 1 then
handle_hud_events(player)
else
hud:remove(player, "hud_event")
hud_queues[pname] = nil
end
end)
player = minetest.get_player_by_name(pname)

if player then
hud:change(player, "hud_event", {text = ""})

hud_queues[pname].t = minetest.after(HUD_SHOW_NEXT_TIME, function()
player = minetest.get_player_by_name(pname)

if player then
if #hud_queues[pname].e >= 1 then
handle_hud_events(player)
else
hud:remove(player, "hud_event")
hud_queues[pname] = nil
end
end
end)
end
end)
end

Expand Down

0 comments on commit 500a3cc

Please sign in to comment.