summaryrefslogtreecommitdiff
path: root/src/newgrf_commons.cpp
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-07-21 17:17:48 +0000
committerplanetmaker <planetmaker@openttd.org>2011-07-21 17:17:48 +0000
commite188edd8f6b332912f0dd721307227709dc3cca5 (patch)
tree89815817f55b36e7187646476cb3fb4bc6a1d222 /src/newgrf_commons.cpp
parente3d98796909d3a1595b75786e14f7495dc7a0ea9 (diff)
downloadopenttd-e188edd8f6b332912f0dd721307227709dc3cca5.tar.xz
(svn r22679) -Change [FS#4692] (r22655): [NewGRF] Use a value of 0 to indicate the invalid waterclass in the nearby land info (0x60 ind. tiles, 0x62 houses, objects,...)
Diffstat (limited to 'src/newgrf_commons.cpp')
-rw-r--r--src/newgrf_commons.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp
index 83d1d4f44..8f7841f8a 100644
--- a/src/newgrf_commons.cpp
+++ b/src/newgrf_commons.cpp
@@ -447,7 +447,8 @@ uint32 GetNearbyTileInformation(TileIndex tile)
uint z;
Slope tileh = GetTileSlope(tile, &z);
- byte terrain_type = (HasTileWaterClass(tile) ? GetWaterClass(tile) : WATER_CLASS_INVALID) << 5 | GetTerrainType(tile) << 2 | (tile_type == MP_WATER ? 1 : 0) << 1;
+ /* Return 0 if the tile is a land tile */
+ byte terrain_type = (HasTileWaterClass(tile) ? (GetWaterClass(tile) + 1) & 3 : 0) << 5 | GetTerrainType(tile) << 2 | (tile_type == MP_WATER ? 1 : 0) << 1;
return tile_type << 24 | z << 16 | terrain_type << 8 | tileh;
}