summaryrefslogtreecommitdiff
path: root/src
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
commit484afacd6375dcc2851e7d174c6fa289a28879f9 (patch)
treeae82b4b3de614dfbcd36f108a2517cde851b5c90 /src
parented6b8410e5df476032c1a5081ef73560db97b0ca (diff)
downloadopenttd-484afacd6375dcc2851e7d174c6fa289a28879f9.tar.xz
(svn r15298) -Fix [FS#2588]: don't start another AI company in MP when there are too many companies
Diffstat (limited to 'src')
-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++;
}