No longer auto-generate a 'guest####' player name when name is empty

You can't join most servers with a 'guest####' player name anyway so
it's only logical to remove them.
master
red-001 2017-01-21 10:44:24 +00:00 committed by paramat
parent 607dab2b0d
commit e2ad76f910
1 changed files with 5 additions and 4 deletions

View File

@ -403,11 +403,12 @@ bool ClientLauncher::launch_game(std::string &error_message,
return false; return false;
} }
if (menudata.name == "") if (menudata.name == "" && !simple_singleplayer_mode) {
menudata.name = std::string("Guest") + itos(myrand_range(1000, 9999)); error_message = gettext("Please choose a name!");
else return false;
playername = menudata.name; }
playername = menudata.name;
password = menudata.password; password = menudata.password;
g_settings->set("name", playername); g_settings->set("name", playername);