Add [new] to world name when supplying a non-existent world on command line

This commit is contained in:
Perttu Ahola 2012-03-13 01:45:38 +02:00
parent 71a3c2fcd1
commit 11b86f8d8a
1 changed files with 5 additions and 3 deletions

View File

@ -1308,10 +1308,12 @@ int main(int argc, char *argv[])
// If a world was commanded, append and select it
if(commanded_world != ""){
std::string gameid = getWorldGameId(commanded_world, true);
if(gameid == "")
std::string name = "[--world parameter]";
if(gameid == ""){
gameid = g_settings->get("default_game");
WorldSpec spec(commanded_world, "[--world parameter]",
gameid);
name += " [new]";
}
WorldSpec spec(commanded_world, name, gameid);
worldspecs.push_back(spec);
menudata.selected_world = worldspecs.size()-1;
}