summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-28 18:37:49 +0000
committerrubidium <rubidium@openttd.org>2010-08-28 18:37:49 +0000
commit8fd9728e193b8bdfa1387429bd087feb12565e19 (patch)
tree958ec8fe10c0c7f7201f9a17cceeb3a694a3a2cf
parente0ba6550d2885ccfade874679fa792648df416f5 (diff)
downloadopenttd-8fd9728e193b8bdfa1387429bd087feb12565e19.tar.xz
(svn r20659) -Feature: make the (flat) area around an industry configurable (Eddi|zuHause)
-rw-r--r--src/industry_cmd.cpp7
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/saveload/saveload.cpp3
-rw-r--r--src/settings_gui.cpp1
-rw-r--r--src/settings_type.h1
-rw-r--r--src/table/settings.h1
6 files changed, 10 insertions, 4 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 013de136f..525af5322 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1452,9 +1452,10 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags,
if (TileX(tile) <= 1 || TileY(tile) <= 1) return false;
/* Check that all tiles in area and surrounding are clear
* this determines that there are no obstructing items */
- TileIndex cur_tile = tile + TileDiffXY(-1, -1);
- uint size_x = max_x + 4;
- uint size_y = max_y + 4;
+
+ TileIndex cur_tile = tile + TileDiffXY(-_settings_game.construction.industry_platform, -_settings_game.construction.industry_platform);
+ uint size_x = max_x + 2 + 2 * _settings_game.construction.industry_platform;
+ uint size_y = max_y + 2 + 2 * _settings_game.construction.industry_platform;
/* Check if we don't leave the map */
if (TileX(cur_tile) + size_x >= MapMaxX() || TileY(cur_tile) + size_y >= MapMaxY()) return false;
diff --git a/src/lang/english.txt b/src/lang/english.txt
index e709825a8..94f73c505 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1111,6 +1111,7 @@ STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD :{LTBLUE}Manual
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE :none
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :as other industries
STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_PROSPECTING :prospecting
+STR_CONFIG_SETTING_INDUSTRY_PLATFORM :{LTBLUE}Flat area around industries: {ORANGE}{STRING1} tile{P 0:1 "" s}
STR_CONFIG_SETTING_MULTIPINDTOWN :{LTBLUE}Allow multiple similar industries per town: {ORANGE}{STRING1}
STR_CONFIG_SETTING_LONGDATE :{LTBLUE}Always show long date in the status bar: {ORANGE}{STRING1}
STR_CONFIG_SETTING_SIGNALSIDE :{LTBLUE}Show signals on the drive side: {ORANGE}{STRING1}
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index b2ba232e2..ba2178717 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -210,8 +210,9 @@
* 145 20376
* 146 20446
* 147 20621
+ * 148 20659
*/
-extern const uint16 SAVEGAME_VERSION = 147; ///< current savegame version of OpenTTD
+extern const uint16 SAVEGAME_VERSION = 148; ///< current savegame version of OpenTTD
SavegameType _savegame_type; ///< type of savegame we are loading
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 071fefd10..ee02055c9 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1371,6 +1371,7 @@ static SettingsPage _settings_economy_towns_page = {_settings_economy_towns, len
static SettingEntry _settings_economy_industries[] = {
SettingEntry("construction.raw_industry_construction"),
+ SettingEntry("construction.industry_platform"),
SettingEntry("economy.multiple_industry_per_town"),
SettingEntry("game_creation.oil_refinery_limit"),
};
diff --git a/src/settings_type.h b/src/settings_type.h
index ba546895c..f353d6da2 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -191,6 +191,7 @@ struct ConstructionSettings {
bool road_stop_on_town_road; ///< allow building of drive-through road stops on town owned roads
bool road_stop_on_competitor_road; ///< allow building of drive-through road stops on roads owned by competitors
uint8 raw_industry_construction; ///< type of (raw) industry construction (none, "normal", prospecting)
+ uint8 industry_platform; ///< the amount of flat land around an industry
bool freeform_edges; ///< allow terraforming the tiles at the map edges
uint8 extra_tree_placement; ///< (dis)allow building extra trees in-game
};
diff --git a/src/table/settings.h b/src/table/settings.h
index 2c75eefc7..52bff244f 100644
--- a/src/table/settings.h
+++ b/src/table/settings.h
@@ -432,6 +432,7 @@ const SettingDesc _settings[] = {
SDT_BOOL(GameSettings, economy.inflation, 0, 0, true, STR_CONFIG_SETTING_INFLATION, NULL),
SDT_VAR(GameSettings, construction.raw_industry_construction, SLE_UINT8, 0,MS, 0, 0, 2, 0, STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD, InvalidateBuildIndustryWindow),
+ SDT_CONDVAR(GameSettings, construction.industry_platform, SLE_UINT8,148, SL_MAX_VERSION, 0, 0, 1, 0, 4, 0, STR_CONFIG_SETTING_INDUSTRY_PLATFORM, NULL),
SDT_BOOL(GameSettings, economy.multiple_industry_per_town, 0, 0, false, STR_CONFIG_SETTING_MULTIPINDTOWN, NULL),
SDT_CONDNULL( 1, 0, 140),
SDT_BOOL(GameSettings, economy.bribe, 0, 0, true, STR_CONFIG_SETTING_BRIBE, NULL),