summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordP <dp@dpointer.org>2021-11-03 23:33:38 +0300
committerGitHub <noreply@github.com>2021-11-03 21:33:38 +0100
commit80e3397f8549f06a6c75a274029560934c45ea7b (patch)
tree337d08d999901185166082045aa2aa9e7738a6fe
parent9edb75ec0b4ecfb2803728d129b353d1d224beaf (diff)
downloadopenttd-80e3397f8549f06a6c75a274029560934c45ea7b.tar.xz
Fix 3a1a915: Every 16th client never reconnects after server restart
-rw-r--r--src/network/network_client.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index bc5f24ac3..f03601b39 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -1055,9 +1055,9 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_NEWGAME(Packet
* care about the server shutting down. */
if (this->status >= STATUS_JOIN) {
/* To throttle the reconnects a bit, every clients waits its
- * Client ID modulo 16. This way reconnects should be spread
- * out a bit. */
- _network_reconnect = _network_own_client_id % 16;
+ * Client ID modulo 16 + 1 (value 0 means no reconnect).
+ * This way reconnects should be spread out a bit. */
+ _network_reconnect = _network_own_client_id % 16 + 1;
ShowErrorMessage(STR_NETWORK_MESSAGE_SERVER_REBOOT, INVALID_STRING_ID, WL_CRITICAL);
}