Skip to content

Commit

Permalink
Allow starting local server using --go again (#10229)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker authored Jul 29, 2020
1 parent 470f328 commit e5725df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client/clientlauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,13 @@ void ClientLauncher::init_args(GameStartData &start_data, const Settings &cmd_ar
// Join a remote server
start_data.address = cmd_args.get("address");
start_data.world_path.clear();
start_data.name = g_settings->get("name");
}
if (!start_data.world_path.empty()) {
// Start a singleplayer instance
start_data.address = "";
}

start_data.name = g_settings->get("name");
if (cmd_args.exists("name"))
start_data.name = cmd_args.get("name");

Expand Down Expand Up @@ -419,7 +419,6 @@ bool ClientLauncher::launch_game(std::string &error_message,
/* Show the GUI menu
*/
std::string server_name, server_description;
start_data.local_server = false;
if (!skip_main_menu) {
// Initialize menu data
// TODO: Re-use existing structs (GameStartData)
Expand Down Expand Up @@ -467,6 +466,9 @@ bool ClientLauncher::launch_game(std::string &error_message,

start_data.local_server = !menudata.simple_singleplayer_mode &&
start_data.address.empty();
} else {
start_data.local_server = !start_data.world_path.empty() &&
start_data.address.empty() && !start_data.name.empty();
}

if (!RenderingEngine::run())
Expand Down

0 comments on commit e5725df

Please sign in to comment.