From e2ad76f91087215309012300eb9f1ebdd7fa40ee Mon Sep 17 00:00:00 2001 From: red-001 Date: Sat, 21 Jan 2017 10:44:24 +0000 Subject: [PATCH] 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. --- src/client/clientlauncher.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index 6145e3dde..1ac67a1de 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -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);