changeset 10959:47278a4d9ee7 draft

(svn r15298) -Fix [FS#2588]: don't start another AI company in MP when there are too many companies
author smatz <smatz@openttd.org>
date Sat, 31 Jan 2009 17:56:06 +0000
parents 599a022ec6d7
children a4e5b5d2837c
files src/company_cmd.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -472,11 +472,14 @@
 
 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++;
 	}