Commit f812e2ae authored by Christopho's avatar Christopho

Fix invalid timer context

parent c4b7e5c8
......@@ -105,6 +105,10 @@ local function initialize_hud_features(game)
-- Called periodically to change the transparency or position of icons.
local function check_hud()
if not hud:is_enabled() then
return true
end
local map = game:get_map()
if map ~= nil then
-- If the hero is below the top-left icons, make them semi-transparent.
......@@ -174,10 +178,6 @@ local function initialize_hud_features(game)
sol.menu.stop(menu)
end
end
if enabled then
sol.timer.start(hud, 50, check_hud)
end
end
end
......@@ -211,6 +211,7 @@ local function initialize_hud_features(game)
-- Start the HUD.
hud:set_enabled(true)
sol.timer.start(game, 50, check_hud)
end
-- Set up the HUD features on any game that starts.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment