diff options
Diffstat (limited to 'builtin/mainmenu.lua')
-rw-r--r-- | builtin/mainmenu.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 677222477..490f9ae4e 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -237,13 +237,11 @@ function menu.update_last_game() if current_world == nil then return end - - for i=1,#gamemgr.games,1 do - if gamemgr.games[i].id == current_world.gameid then - menu.last_game = i - engine.setting_set("main_menu_last_game_idx",menu.last_game) - break - end + + local gamespec, i = gamemgr.find_by_gameid(current_world.gameid) + if i ~= nil then + menu.last_game = i + engine.setting_set("main_menu_last_game_idx",menu.last_game) end end |