summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-06-11 04:52:51 +0000
committermaedhros <maedhros@openttd.org>2007-06-11 04:52:51 +0000
commit41443a26a69ec2ea1f9f8b52a5bcce5014b55a4a (patch)
treea860d571fe4e1e93e7f0507acb114ece1d9156cd /src/newgrf_station.cpp
parent7f8b42b59842c412575355634d5c62ef2cf8973d (diff)
downloadopenttd-41443a26a69ec2ea1f9f8b52a5bcce5014b55a4a.tar.xz
(svn r10089) -Fix (r10040): Use GetTileZ instead of GetClearGround in GetTerrainType as
GetTileZ is valid for any tile type. Also use GetTerrainType for stations.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index d00d925af..e53e4d912 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -15,6 +15,7 @@
#include "station_map.h"
#include "newgrf.h"
#include "newgrf_callbacks.h"
+#include "newgrf_commons.h"
#include "newgrf_station.h"
#include "newgrf_spritegroup.h"
#include "date.h"
@@ -388,10 +389,7 @@ static uint32 StationGetVariable(const ResolverObject *object, byte variable, by
/* Calculated station variables */
case 0x40: return GetPlatformInfoHelper(tile, false, false, false);
case 0x41: return GetPlatformInfoHelper(tile, true, false, false);
- case 0x42: // Terrain and rail type
- return ((_opt.landscape == LT_ARCTIC && GetTileZ(tile) > GetSnowLine()) ? 4 : 0) |
- (_opt.landscape == LT_TROPIC ? GetTropicZone(tile) : 0) |
- (GetRailType(tile) << 8);
+ case 0x42: return GetTerrainType(tile) | (GetRailType(tile) << 8);
case 0x43: return st->owner; // Station owner
case 0x44: return 2; // PBS status
case 0x45: return GetRailContinuationInfo(tile);