(svn r15282) -Fix: it was possible to start more than MAX_COMPANIES companies

This commit is contained in:
glx 2009-01-27 02:02:04 +00:00
parent 9cf1a19762
commit 7d45e8b376
1 changed files with 1 additions and 1 deletions

View File

@ -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();