From 416c7d5ddaace157925d1d4220479be89a1cb13a Mon Sep 17 00:00:00 2001 From: smatz Date: Sat, 31 Jan 2009 17:56:06 +0000 Subject: (svn r15298) -Fix [FS#2588]: don't start another AI company in MP when there are too many companies --- src/company_cmd.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/company_cmd.cpp') 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++; } -- cgit v1.2.3-54-g00ecf