summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-31 17:56:06 +0000
committersmatz <smatz@openttd.org>2009-01-31 17:56:06 +0000
commit416c7d5ddaace157925d1d4220479be89a1cb13a (patch)
treeae82b4b3de614dfbcd36f108a2517cde851b5c90
parenta0df8d13382101d4679ec3cbeea08322ab84c633 (diff)
downloadopenttd-416c7d5ddaace157925d1d4220479be89a1cb13a.tar.xz
(svn r15298) -Fix [FS#2588]: don't start another AI company in MP when there are too many companies
-rw-r--r--src/company_cmd.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 82c34f3e1..31e9bcef0 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -472,11 +472,14 @@ void StartupCompanies()
static void MaybeStartNewCompany()
{
- uint n;
+#ifdef ENABLE_NETWORK
+ if (_networking && ActiveCompanyCount() >= _settings_client.network.max_companies) return;
+#endif /* ENABLE_NETWORK */
+
Company *c;
/* count number of competitors */
- n = 0;
+ uint n = 0;
FOR_ALL_COMPANIES(c) {
if (c->is_ai) n++;
}