aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/clientlauncher.cpp9
1 files 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);