summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-02-05 13:46:09 +0000
committerterkhen <terkhen@openttd.org>2011-02-05 13:46:09 +0000
commita4b08dddd10062f49352b5aee49e392f95e281e2 (patch)
tree99cc5f5db98321e039b9b61fbe084b6f1fe80220
parent91dcc9e0164987f6b17ed3a28e8ee2b497133c84 (diff)
downloadopenttd-a4b08dddd10062f49352b5aee49e392f95e281e2.tar.xz
(svn r21974) -Feature: Add a setting to enable/disable funding local road reconstruction.
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/saveload/saveload.cpp2
-rw-r--r--src/settings_gui.cpp1
-rw-r--r--src/settings_type.h1
-rw-r--r--src/table/settings.h1
-rw-r--r--src/town_cmd.cpp6
6 files changed, 11 insertions, 1 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 5ed071ec7..24297046c 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1134,6 +1134,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_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}
STR_CONFIG_SETTING_PLANE_SPEED :{LTBLUE}Plane speed factor: {ORANGE}1 / {STRING1}
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 921fc704d..ce3281715 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -224,7 +224,7 @@
* 157 21862
* 158 21933
* 159 21962
- * 160 21969
+ * 160 21974
*/
extern const uint16 SAVEGAME_VERSION = 160; ///< Current savegame version of OpenTTD.
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 2d279269b..576f49db0 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1368,6 +1368,7 @@ static SettingsPage _settings_stations_page = {_settings_stations, lengthof(_set
static SettingEntry _settings_economy_towns[] = {
SettingEntry("economy.bribe"),
SettingEntry("economy.exclusive_rights"),
+ SettingEntry("economy.fund_roads"),
SettingEntry("economy.town_layout"),
SettingEntry("economy.allow_town_roads"),
SettingEntry("economy.allow_town_level_crossings"),
diff --git a/src/settings_type.h b/src/settings_type.h
index e5738d686..4c24887e5 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -367,6 +367,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_roads; ///< allow funding local road reconstruction
bool give_money; ///< allow giving other companies money
bool mod_road_rebuild; ///< roadworks remove unneccesary RoadBits
bool multiple_industry_per_town; ///< allow many industries of the same type per town
diff --git a/src/table/settings.h b/src/table/settings.h
index fc3b9c234..cf2a752b0 100644
--- a/src/table/settings.h
+++ b/src/table/settings.h
@@ -451,6 +451,7 @@ const SettingDesc _settings[] = {
SDT_CONDNULL( 1, 0, 140),
SDT_BOOL(GameSettings, economy.bribe, 0, 0, true, STR_CONFIG_SETTING_BRIBE, RedrawTownAuthority),
SDT_CONDBOOL(GameSettings, economy.exclusive_rights, 79, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_ALLOW_EXCLUSIVE, RedrawTownAuthority),
+ SDT_CONDBOOL(GameSettings, economy.fund_roads, 160, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_ALLOW_FUND_ROAD, RedrawTownAuthority),
SDT_CONDBOOL(GameSettings, economy.give_money, 79, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_ALLOW_GIVE_MONEY, NULL),
SDT_VAR(GameSettings, game_creation.snow_line_height, SLE_UINT8, 0, 0, DEF_SNOWLINE_HEIGHT, MIN_SNOWLINE_HEIGHT, MAX_SNOWLINE_HEIGHT, 0, STR_CONFIG_SETTING_SNOWLINE_HEIGHT, NULL),
SDT_CONDNULL( 4, 0, 143),
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index b043a0450..613af54d6 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2469,6 +2469,9 @@ static CommandCost TownActionAdvertiseLarge(Town *t, DoCommandFlag flags)
static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlag flags)
{
+ /* Check if the company is allowed to fund new roads. */
+ if (!_settings_game.economy.fund_roads) return CMD_ERROR;
+
if (flags & DC_EXEC) {
t->road_build_months = 6;
@@ -2639,6 +2642,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 local road reconstruction? */
+ if (cur == TACT_ROAD_REBUILD && !_settings_game.economy.fund_roads) continue;
+
/* Is the company not able to build a statue ? */
if (cur == TACT_BUILD_STATUE && HasBit(t->statues, cid)) continue;