From: red-001 Date: Sat, 21 Jan 2017 10:44:24 +0000 (+0000) Subject: No longer auto-generate a 'guest####' player name when name is empty X-Git-Tag: 0.4.16~451 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e2ad76f91087215309012300eb9f1ebdd7fa40ee;p=oweals%2Fminetest.git 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. --- 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);