summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorJack Baron <jackmbaron@gmail.com>2019-10-18 01:47:29 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-10-19 20:31:44 +0100
commit7c9dedb94f3b3ebca222f544f7d7502f22d03bb7 (patch)
tree774c0a7e71ef1db71f3618987d5ccede2c810e28 /src/economy.cpp
parent53f8d0b815a7be57fb6489d95e67b9002ade14d7 (diff)
downloadopenttd-7c9dedb94f3b3ebca222f544f7d7502f22d03bb7.tar.xz
Feature: Configure minimum share trading years
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index e8fbea094..6fd795b35 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -2030,7 +2030,7 @@ CommandCost CmdBuyShareInCompany(TileIndex tile, DoCommandFlag flags, uint32 p1,
if (c == nullptr || !_settings_game.economy.allow_shares || _current_company == target_company) return CMD_ERROR;
/* Protect new companies from hostile takeovers */
- if (_cur_year - c->inaugurated_year < 6) return_cmd_error(STR_ERROR_PROTECTED);
+ if (_cur_year - c->inaugurated_year < _settings_game.economy.min_years_for_shares) return_cmd_error(STR_ERROR_PROTECTED);
/* Those lines are here for network-protection (clients can be slow) */
if (GetAmountOwnedBy(c, COMPANY_SPECTATOR) == 0) return cost;