diff options
author | maedhros <maedhros@openttd.org> | 2007-03-20 13:47:00 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-03-20 13:47:00 +0000 |
commit | 48f2bf9bb1bd7b8859d3527c6c205386471cc4e4 (patch) | |
tree | a58aa837d70b430e5ab2ea0f71158e3b6032453b /src/industry_cmd.cpp | |
parent | 7812f7fd0ac617a9df41730e6770519154bc5344 (diff) | |
download | openttd-48f2bf9bb1bd7b8859d3527c6c205386471cc4e4.tar.xz |
(svn r9371) -Feature: Add support for variable snow lines in the arctic climate, supplied
by newgrf files. When this is enabled forests cannot be built below the highest
snow line, and farms can't be built above it. Houses still use the
_opt.snow_line so they are all consistent, so to make them respect the snowline
you may want to use some newhouses features as well.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 2352c52da..f237dcf7b 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -12,6 +12,7 @@ #include "table/sprites.h" #include "map.h" #include "tile.h" +#include "landscape.h" #include "viewport.h" #include "command.h" #include "industry.h" @@ -814,7 +815,7 @@ static void PlantFarmField(TileIndex tile, IndustryID industry) int type; if (_opt.landscape == LT_HILLY) { - if (GetTileZ(tile) + TILE_HEIGHT * 2 >= _opt.snow_line) + if (GetTileZ(tile) + TILE_HEIGHT * 2 >= GetSnowLine()) return; } @@ -1016,7 +1017,7 @@ static bool CheckNewIndustry_NULL(TileIndex tile) static bool CheckNewIndustry_Forest(TileIndex tile) { if (_opt.landscape == LT_HILLY) { - if (GetTileZ(tile) < _opt.snow_line + TILE_HEIGHT * 2U) { + if (GetTileZ(tile) < HighestSnowLine() + TILE_HEIGHT * 2U) { _error_message = STR_4831_FOREST_CAN_ONLY_BE_PLANTED; return false; } @@ -1048,7 +1049,7 @@ static bool CheckNewIndustry_OilRig(TileIndex tile) static bool CheckNewIndustry_Farm(TileIndex tile) { if (_opt.landscape == LT_HILLY) { - if (GetTileZ(tile) + TILE_HEIGHT * 2 >= _opt.snow_line) { + if (GetTileZ(tile) + TILE_HEIGHT * 2 >= HighestSnowLine()) { _error_message = STR_0239_SITE_UNSUITABLE; return false; } |