summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index ed9212cd2..a9a61850d 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1600,6 +1600,9 @@ CommandCost CmdBuyCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Do not allow companies to take over themselves */
if (target_company == _current_company) return CMD_ERROR;
+ /* Disable taking over when not allowed. */
+ if (!MayCompanyTakeOver(_current_company, target_company)) return CMD_ERROR;
+
/* Get the cost here as the company is deleted in DoAcquireCompany. */
CommandCost cost(EXPENSES_OTHER, c->bankrupt_value);