mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Improve UX when no game exists and drop default_game
(#13550)
This commit is contained in:
parent
5bfc5d44c0
commit
a88e61c2cf
9 changed files with 78 additions and 80 deletions
|
@ -397,11 +397,6 @@ bool ClientLauncher::launch_game(std::string &error_message,
|
|||
spec.path = start_data.world_path;
|
||||
spec.gameid = getWorldGameId(spec.path, true);
|
||||
spec.name = _("[--world parameter]");
|
||||
|
||||
if (spec.gameid.empty()) { // Create new
|
||||
spec.gameid = g_settings->get("default_game");
|
||||
spec.name += " [new]";
|
||||
}
|
||||
}
|
||||
|
||||
/* Show the GUI menu
|
||||
|
|
|
@ -367,7 +367,6 @@ void set_default_settings()
|
|||
settings->setDefault("max_simultaneous_block_sends_per_client", "40");
|
||||
settings->setDefault("time_send_interval", "5");
|
||||
|
||||
settings->setDefault("default_game", "minetest");
|
||||
settings->setDefault("motd", "");
|
||||
settings->setDefault("max_users", "15");
|
||||
settings->setDefault("creative_mode", "false");
|
||||
|
|
16
src/main.cpp
16
src/main.cpp
|
@ -994,15 +994,15 @@ static bool determine_subgame(GameParams *game_params)
|
|||
if (game_params->game_spec.isValid()) {
|
||||
gamespec = game_params->game_spec;
|
||||
infostream << "Using commanded gameid [" << gamespec.id << "]" << std::endl;
|
||||
} 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 << "Game specified in default_game ["
|
||||
<< g_settings->get("default_game")
|
||||
<< "] is invalid." << std::endl;
|
||||
return false;
|
||||
} else {
|
||||
if (game_params->is_dedicated_server) {
|
||||
// If this is a dedicated server and no gamespec has been specified,
|
||||
// print a friendly error pointing to ContentDB.
|
||||
errorstream << "To run a " PROJECT_NAME_C " server, you need to select a game using the '--gameid' argument." << std::endl
|
||||
<< "Check out https://content.minetest.net for a selection of games to pick from and download." << std::endl;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
} else { // World exists
|
||||
std::string world_gameid = getWorldGameId(game_params->world_path, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue