diff options
author | frosch <frosch@openttd.org> | 2010-03-21 15:16:05 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-03-21 15:16:05 +0000 |
commit | 475c2959bd119190d2c5f2196717de2f8849c99b (patch) | |
tree | 1d22baf0ae45b79a996425fd7293a4ec58d5fa26 /src/industry_cmd.cpp | |
parent | e188c5d87c2092a7fd711493d6f7f045c0c9783b (diff) | |
download | openttd-475c2959bd119190d2c5f2196717de2f8849c99b.tar.xz |
(svn r19499) -Remove: same_industry_close setting did not do what it said and caused NewGRF trouble.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 27ba3f364..bbf000ba6 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1518,35 +1518,19 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags, } -/** Check that the new industry is far enough from other industries. +/** Check that the new industry is far enough from conflicting industries. * @param tile Tile to construct the industry. * @param type Type of the new industry. * @return Succeeded or failed command. */ -static CommandCost CheckIfFarEnoughFromIndustry(TileIndex tile, int type) +static CommandCost CheckIfFarEnoughFromConflictingIndustry(TileIndex tile, int type) { const IndustrySpec *indspec = GetIndustrySpec(type); - - if (_settings_game.economy.same_industry_close && indspec->IsRawIndustry()) { - /* Allow primary industries to be placed close to any other industry */ - return CommandCost(); - } - const Industry *i; FOR_ALL_INDUSTRIES(i) { /* Within 14 tiles from another industry is considered close */ if (DistanceMax(tile, i->location.tile) > 14) continue; - /* check if an industry that accepts the same goods is nearby */ - if (!indspec->IsRawIndustry() && // not a primary industry? - indspec->accepts_cargo[0] == i->accepts_cargo[0] && ( - /* at least one of those options must be true */ - _game_mode != GM_EDITOR || // editor must not be stopped - !_settings_game.economy.same_industry_close || - !_settings_game.economy.multiple_industry_per_town)) { - return_cmd_error(STR_ERROR_INDUSTRY_TOO_CLOSE); - } - /* check if there are any conflicting industry types around */ if (i->type == indspec->conflicting[0] || i->type == indspec->conflicting[1] || @@ -1732,7 +1716,7 @@ static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do return_cmd_error(STR_ERROR_SITE_UNSUITABLE); } - ret = CheckIfFarEnoughFromIndustry(tile, type); + ret = CheckIfFarEnoughFromConflictingIndustry(tile, type); if (ret.Failed()) return ret; const Town *t = NULL; |