Skip to content

Instantly share code, notes, and snippets.

@Zeno-
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zeno-/642751186ad8e029efd5 to your computer and use it in GitHub Desktop.
Save Zeno-/642751186ad8e029efd5 to your computer and use it in GitHub Desktop.
From bbdd7789f1968e8bfe910e29bbc305c1145eead0 Mon Sep 17 00:00:00 2001
From: Craig Robbins <kde.psych@gmail.com>
Date: Sat, 13 Dec 2014 22:34:34 +1000
Subject: [PATCH] Provide more info if a subgame is not valid/found
---
src/main.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/main.cpp b/src/main.cpp
index d9fa8fa..d7828ea 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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);
--
1.9.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment