summaryrefslogtreecommitdiff
path: root/src/newgrf_house.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-08 17:29:01 +0000
committerfrosch <frosch@openttd.org>2011-11-08 17:29:01 +0000
commit8f4c6d42f90dc6bda68c803bebec48a9382eb675 (patch)
treeb2c9b3e4e53cfcb2433ea5acb4553c7516ae2d0a /src/newgrf_house.cpp
parent5aaecae6e2ea2c2236375274439645e669081328 (diff)
downloadopenttd-8f4c6d42f90dc6bda68c803bebec48a9382eb675.tar.xz
(svn r23154) -Change: [NewGRF v8] Use heightlevel units in nearby tile info variables. (rubidium)
Diffstat (limited to 'src/newgrf_house.cpp')
-rw-r--r--src/newgrf_house.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index 5e841b7d1..0ce9c8855 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -132,10 +132,17 @@ static uint32 GetNumHouses(HouseID house_id, const Town *town)
return map_class_count << 24 | town_class_count << 16 | map_id_count << 8 | town_id_count;
}
-uint32 GetNearbyTileInformation(byte parameter, TileIndex tile)
+/**
+ * Get information about a nearby tile.
+ * @param parameter from callback. It's in fact a pair of coordinates
+ * @param tile TileIndex from which the callback was initiated
+ * @param grf_version8 True, if we are dealing with a new NewGRF which uses GRF version >= 8.
+ * @return a construction of bits obeying the newgrf format
+ */
+static uint32 GetNearbyTileInformation(byte parameter, TileIndex tile, bool grf_version8)
{
tile = GetNearbyTile(parameter, tile);
- return GetNearbyTileInformation(tile);
+ return GetNearbyTileInformation(tile, grf_version8);
}
/** Structure with user-data for SearchNearbyHouseXXX - functions */
@@ -302,7 +309,7 @@ static uint32 HouseGetVariable(const ResolverObject *object, byte variable, uint
}
/* Land info for nearby tiles. */
- case 0x62: return GetNearbyTileInformation(parameter, tile);
+ case 0x62: return GetNearbyTileInformation(parameter, tile, object->grffile->grf_version >= 8);
/* Current animation frame of nearby house tiles */
case 0x63: {