diff options
author | glx <glx@openttd.org> | 2009-01-27 02:02:04 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2009-01-27 02:02:04 +0000 |
commit | a92f792433371a047ead4036f97445e1a0388d7e (patch) | |
tree | 6b1a00c78b6d451773dd7feb5dc7bb394f4bb939 /src | |
parent | 049e535065d1661b64068fc96c9e59d6f6cb378c (diff) | |
download | openttd-a92f792433371a047ead4036f97445e1a0388d7e.tar.xz |
(svn r15282) -Fix: it was possible to start more than MAX_COMPANIES companies
Diffstat (limited to 'src')
-rw-r--r-- | src/company_cmd.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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(); |