Skip to content

Commit

Permalink
Fix crash in mainmenu when loaded subgame does not have a "menu" dire…
Browse files Browse the repository at this point in the history
…ctory
  • Loading branch information
sfan5 committed Jul 21, 2015
1 parent 254dbe7 commit 5b0c719
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions builtin/mainmenu/textures.lua
Expand Up @@ -144,10 +144,11 @@ function mm_texture.set_game(identifier, gamedetails)
end

-- Find out how many randomized textures the subgame provides
local n, filename
local n = 0
local filename
local menu_files = core.get_dir_list(gamedetails.path .. DIR_DELIM .. "menu", false)
for i = 1, #menu_files do
local filename = identifier .. "." .. i .. ".png"
filename = identifier .. "." .. i .. ".png"
if table.indexof(menu_files, filename) == -1 then
n = i - 1
break
Expand Down

0 comments on commit 5b0c719

Please sign in to comment.