summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/settings_type.h1
-rw-r--r--src/table/settings.ini8
-rw-r--r--src/town_cmd.cpp6
4 files changed, 16 insertions, 0 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 144c75ad4..dee24733b 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1142,6 +1142,7 @@ STR_CONFIG_SETTING_ROAD_VEHICLE_QUEUEING :{LTBLUE}Road ve
STR_CONFIG_SETTING_AUTOSCROLL :{LTBLUE}Pan window when mouse is at the edge: {ORANGE}{STRING1}
STR_CONFIG_SETTING_BRIBE :{LTBLUE}Allow bribing of the local authority: {ORANGE}{STRING1}
STR_CONFIG_SETTING_ALLOW_EXCLUSIVE :{LTBLUE}Allow buying exclusive transport rights: {ORANGE}{STRING1}
+STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS :{LTBLUE}Allow funding buildings: {ORANGE}{STRING1}
STR_CONFIG_SETTING_ALLOW_FUND_ROAD :{LTBLUE}Allow funding local road reconstruction: {ORANGE}{STRING1}
STR_CONFIG_SETTING_ALLOW_GIVE_MONEY :{LTBLUE}Allow sending money to other companies: {ORANGE}{STRING1}
STR_CONFIG_SETTING_FREIGHT_TRAINS :{LTBLUE}Weight multiplier for freight to simulate heavy trains: {ORANGE}{STRING}
diff --git a/src/settings_type.h b/src/settings_type.h
index 12063f10c..9fe550240 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -395,6 +395,7 @@ struct EconomySettings {
uint8 feeder_payment_share; ///< percentage of leg payment to virtually pay in feeder systems
byte dist_local_authority; ///< distance for town local authority, default 20
bool exclusive_rights; ///< allow buying exclusive rights
+ bool fund_buildings; ///< allow funding new buildings
bool fund_roads; ///< allow funding local road reconstruction
bool give_money; ///< allow giving other companies money
bool mod_road_rebuild; ///< roadworks remove unneccesary RoadBits
diff --git a/src/table/settings.ini b/src/table/settings.ini
index f519db615..c19f718e2 100644
--- a/src/table/settings.ini
+++ b/src/table/settings.ini
@@ -1008,6 +1008,14 @@ proc = RedrawTownAuthority
[SDT_BOOL]
base = GameSettings
+var = economy.fund_buildings
+from = 165
+def = true
+str = STR_CONFIG_SETTING_ALLOW_FUND_BUILDINGS
+proc = RedrawTownAuthority
+
+[SDT_BOOL]
+base = GameSettings
var = economy.fund_roads
from = 160
def = true
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 7c67d064e..e303a2515 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2578,6 +2578,9 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
static CommandCost TownActionFundBuildings(Town *t, DoCommandFlag flags)
{
+ /* Check if it's allowed to buy the rights */
+ if (!_settings_game.economy.fund_buildings) return CMD_ERROR;
+
if (flags & DC_EXEC) {
/* Build next tick */
t->grow_counter = 1;
@@ -2680,6 +2683,9 @@ uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t)
/* Is the company not able to buy exclusive rights ? */
if (cur == TACT_BUY_RIGHTS && !_settings_game.economy.exclusive_rights) continue;
+ /* Is the company not able to fund buildings ? */
+ if (cur == TACT_FUND_BUILDINGS && !_settings_game.economy.fund_buildings) continue;
+
/* Is the company not able to fund local road reconstruction? */
if (cur == TACT_ROAD_REBUILD && !_settings_game.economy.fund_roads) continue;