summaryrefslogtreecommitdiff
path: root/src/company_cmd.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-02-04 17:19:21 +0000
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-02-05 14:49:04 +0100
commitb1e40b6b569c206d672f677a8e474a73ecf2173b (patch)
treea75b612a54da68a757987cfcef0d8e1a0a2d6739 /src/company_cmd.cpp
parent64878320ccac0854b0712730e5f9dedcf0bb591d (diff)
downloadopenttd-b1e40b6b569c206d672f677a8e474a73ecf2173b.tar.xz
Fix #7151: Hang when concurrently starting AIs in multiplayer, or with shift pressed.
Diffstat (limited to 'src/company_cmd.cpp')
-rw-r--r--src/company_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 392f97afb..77572c5af 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -724,6 +724,10 @@ void OnTick_Companies()
/* Allow multiple AIs to possibly start in the same tick. */
do {
if (!MaybeStartNewCompany()) break;
+
+ /* In networking mode, we can only send a command to start but it
+ * didn't execute yet, so we cannot loop. */
+ if (_networking) break;
} while (AI::GetStartNextTime() == 0);
}