aboutsummaryrefslogtreecommitdiff
path: root/src/client/clientlauncher.cpp
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-01-21 10:44:24 +0000
committerparamat <mat.gregory@virginmedia.com>2017-02-09 00:05:19 +0000
commite2ad76f91087215309012300eb9f1ebdd7fa40ee (patch)
tree894fae06c83601bfd5014e26cd739c16c1bdab61 /src/client/clientlauncher.cpp
parent607dab2b0dff3ca5bf59263e18f8eaab3c21b946 (diff)
downloadminetest-e2ad76f91087215309012300eb9f1ebdd7fa40ee.tar.gz
minetest-e2ad76f91087215309012300eb9f1ebdd7fa40ee.tar.bz2
minetest-e2ad76f91087215309012300eb9f1ebdd7fa40ee.zip
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.
Diffstat (limited to 'src/client/clientlauncher.cpp')
-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);