Skip to content

Commit 2dcbc01

Browse files
red-001sfan5
authored andcommittedFeb 16, 2017
Fix a small regression caused by e2ad76f.
1 parent a5e4273 commit 2dcbc01

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
 

‎src/client/clientlauncher.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,6 @@ bool ClientLauncher::launch_game(std::string &error_message,
411411
playername = menudata.name;
412412
password = menudata.password;
413413

414-
g_settings->set("name", playername);
415-
416414
current_playername = playername;
417415
current_password = password;
418416
current_address = address;
@@ -425,13 +423,16 @@ bool ClientLauncher::launch_game(std::string &error_message,
425423
current_password = "";
426424
current_address = "";
427425
current_port = myrand_range(49152, 65535);
428-
} else if (address != "") {
429-
ServerListSpec server;
430-
server["name"] = menudata.servername;
431-
server["address"] = menudata.address;
432-
server["port"] = menudata.port;
433-
server["description"] = menudata.serverdescription;
434-
ServerList::insert(server);
426+
} else {
427+
g_settings->set("name", playername);
428+
if (address != "") {
429+
ServerListSpec server;
430+
server["name"] = menudata.servername;
431+
server["address"] = menudata.address;
432+
server["port"] = menudata.port;
433+
server["description"] = menudata.serverdescription;
434+
ServerList::insert(server);
435+
}
435436
}
436437

437438
infostream << "Selected world: " << worldspec.name

0 commit comments

Comments
 (0)
Please sign in to comment.