summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/company_cmd.cpp2
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();