diff options
author | frosch <frosch@openttd.org> | 2011-10-21 19:10:35 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-10-21 19:10:35 +0000 |
commit | 3eddb9c23fcc4aac9fc32bd6e923eada4bdcd9e5 (patch) | |
tree | aa9b65f4e4035f8bea81c287d2f109143598692b /src/station_cmd.cpp | |
parent | 3e5a75839015c86400736b6047859e1023b37b96 (diff) | |
download | openttd-3eddb9c23fcc4aac9fc32bd6e923eada4bdcd9e5.tar.xz |
(svn r23049) -Fix [FS#4810]: Use the same forest-check for the vegetation-map colour as for nearby station names.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 18afebe7d..02d00238c 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -180,29 +180,6 @@ static bool CMSATree(TileIndex tile) return IsTileType(tile, MP_TREES); } -/** - * Check whether the tile is a forest. - * @param tile the tile to investigate. - * @return true if and only if the tile is a forest - */ -static bool CMSAForest(TileIndex tile) -{ - /* No industry */ - if (!IsTileType(tile, MP_INDUSTRY)) return false; - - const Industry *ind = Industry::GetByTile(tile); - - /* No extractive industry */ - if ((GetIndustrySpec(ind->type)->life_type & INDUSTRYLIFE_ORGANIC) == 0) return false; - - for (uint i = 0; i < lengthof(ind->produced_cargo); i++) { - /* The industry produces wood. */ - if (ind->produced_cargo[i] != CT_INVALID && CargoSpec::Get(ind->produced_cargo[i])->label == 'WOOD') return true; - } - - return false; -} - #define M(x) ((x) - STR_SV_STNAME) enum StationNaming { @@ -322,7 +299,7 @@ static StringID GenerateStationName(Station *st, TileIndex tile, StationNaming n /* Check woods */ if (HasBit(free_names, M(STR_SV_STNAME_WOODS)) && ( CountMapSquareAround(tile, CMSATree) >= 8 || - CountMapSquareAround(tile, CMSAForest) >= 2) + CountMapSquareAround(tile, IsTileForestIndustry) >= 2) ) { return _settings_game.game_creation.landscape == LT_TROPIC ? STR_SV_STNAME_FOREST : STR_SV_STNAME_WOODS; } |