Feature: Configure minimum share trading years
This commit is contained in:

committed by
Charles Pigott

parent
53f8d0b815
commit
7c9dedb94f
@@ -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;
|
||||
|
Reference in New Issue
Block a user