No longer auto-generate a 'guest####' player name when name is empty
authorred-001 <red-001@outlook.ie>
Sat, 21 Jan 2017 10:44:24 +0000 (10:44 +0000)
committerparamat <mat.gregory@virginmedia.com>
Thu, 9 Feb 2017 00:05:19 +0000 (00:05 +0000)
You can't join most servers with a 'guest####' player name anyway so
it's only logical to remove them.

src/client/clientlauncher.cpp

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