From 7d45e8b376d30bb70213a74eee2ec128254948af Mon Sep 17 00:00:00 2001 From: glx Date: Tue, 27 Jan 2009 02:02:04 +0000 Subject: (svn r15282) -Fix: it was possible to start more than MAX_COMPANIES companies --- src/company_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 2c9bd26ab..82c34f3e1 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -424,7 +424,7 @@ void ResetCompanyLivery(Company *c) */ Company *DoStartupNewCompany(bool is_ai) { - if (!Company::CanAllocateItem()) return NULL; + if (ActiveCompanyCount() == MAX_COMPANIES || !Company::CanAllocateItem()) return NULL; /* we have to generate colour before this company is valid */ Colours colour = GenerateCompanyColour(); -- cgit v1.2.3-54-g00ecf