Fix Android main menu crash, and user data directory check.
authorKodexky <kodexky@gmail.com>
Mon, 24 Nov 2014 07:01:30 +0000 (02:31 -0430)
committerCraig Robbins <kde.psych@gmail.com>
Wed, 26 Nov 2014 08:11:08 +0000 (18:11 +1000)
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
builtin/mainmenu/init.lua
src/main.cpp

index 6ad2aa88a93ffe8bb5c6338515e15a09b80b706e..e5820833619e576d685079e1c9ee9bf900ac9600 100644 (file)
@@ -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
index 8ba24f307d6e6fdd89b8855cc205485adbe1cc5e..23ce01073bd745a925a8c34c1c74d47f5863dfe4 100644 (file)
@@ -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