Provide more info if a subgame is not valid/found
authorCraig Robbins <kde.psych@gmail.com>
Sat, 13 Dec 2014 13:01:16 +0000 (23:01 +1000)
committerCraig Robbins <kde.psych@gmail.com>
Sat, 13 Dec 2014 13:01:16 +0000 (23:01 +1000)
src/main.cpp

index d9fa8faa2f749aa988a8be59545dae0012318d24..73964c2b0d0208fb593593f32441ef32e55af57b 100644 (file)
@@ -1395,6 +1395,12 @@ static bool determine_subgame(GameParams *game_params)
                } else { // Otherwise we will be using "minetest"
                        gamespec = findSubgame(g_settings->get("default_game"));
                        infostream << "Using default gameid [" << gamespec.id << "]" << std::endl;
+                       if (!gamespec.isValid()) {
+                               errorstream << "Subgame specified in default_game ["
+                                           << g_settings->get("default_game")
+                                           << "] is invalid." << std::endl;
+                               return false;
+                       }
                }
        } else { // World exists
                std::string world_gameid = getWorldGameId(game_params->world_path, false);