aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-03-15 08:55:45 +0100
committerest31 <MTest31@outlook.com>2016-03-15 08:55:45 +0100
commit2607b97b4f2b41767d7a010e9376d3e7f578cb71 (patch)
treee1261afbebfc3dbdc0e2d47aaf963a5947898232 /src/client
parente0151d1054c9923630b8ae9cdae36efa261756d3 (diff)
downloadminetest-2607b97b4f2b41767d7a010e9376d3e7f578cb71.tar.gz
minetest-2607b97b4f2b41767d7a010e9376d3e7f578cb71.tar.bz2
minetest-2607b97b4f2b41767d7a010e9376d3e7f578cb71.zip
Fix two reconnect bugs
Fix two bugs related to the reconnect feature introduced by commit 3b50b2766aeb09c9fc0ad0ea07426bb2187df3d7 "Optional reconnect functionality" 1. Set the password to the stored one Before, we have done the reconnect attempt with a cleared password, so using the feature would only work if you had an empty password. Thanks to @orwell96 for reporting the bug. 2. Reset the reconnect_requested flag after its use the_game only writes to the reconect_requested flag if it sets it to true. It never sets it to false. If the flag is not reset after its use, all "reset"s to the main menu will look like the server had requested a reconnect.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/clientlauncher.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp
index 357d98b4d..404a16310 100644
--- a/src/client/clientlauncher.cpp
+++ b/src/client/clientlauncher.cpp
@@ -201,6 +201,9 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
bool game_has_run = launch_game(error_message, reconnect_requested,
game_params, cmd_args);
+ // Reset the reconnect_requested flag
+ reconnect_requested = false;
+
// If skip_main_menu, we only want to startup once
if (skip_main_menu && !first_loop)
break;
@@ -336,6 +339,7 @@ bool ClientLauncher::launch_game(std::string &error_message,
MainMenuData menudata;
menudata.address = address;
menudata.name = playername;
+ menudata.password = password;
menudata.port = itos(game_params.socket_port);
menudata.script_data.errormessage = error_message;
menudata.script_data.reconnect_requested = reconnect_requested;