From: Kodexky Date: Mon, 24 Nov 2014 07:01:30 +0000 (-0430) Subject: Fix Android main menu crash, and user data directory check. X-Git-Tag: 0.4.11~137 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9aaf67ebe0d6b05294695df6b0c8031f26b9a673;p=oweals%2Fminetest.git Fix Android main menu crash, and user data directory check. Signed-off-by: Craig Robbins --- diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 6ad2aa88a..e58208336 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -97,7 +97,7 @@ local function init_globals() local found_singleplayerworld = false - for world in pairs(world_list) do + for i,world in pairs(world_list) do if world.name == "singleplayerworld" then found_singleplayerworld = true gamedata.worldindex = i @@ -110,10 +110,10 @@ local function init_globals() local world_list = core.get_worlds() - for world in pairs(world_list) do + for i,world in pairs(world_list) do if world.name == "singleplayerworld" then gamedata.worldindex = i - return + break end end end diff --git a/src/main.cpp b/src/main.cpp index 8ba24f307..23ce01073 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1071,6 +1071,8 @@ static bool create_userdata_path() porting::setExternalStorageDir(porting::jnienv); if (!fs::PathExists(porting::path_user)) { success = fs::CreateDir(porting::path_user); + } else { + success = true; } porting::copyAssets(); #else