diff options
author | michi_cc <michi_cc@openttd.org> | 2011-07-11 16:32:35 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-07-11 16:32:35 +0000 |
commit | d579af11e8c903c8019489c9a567b68cdd153b69 (patch) | |
tree | 5ec23b092d4f0fa6dc6529605e62a20c022b65c3 /src/newgrf_commons.cpp | |
parent | e5dd6f922799a5f741d5e040efcd689f0f5e875b (diff) | |
download | openttd-d579af11e8c903c8019489c9a567b68cdd153b69.tar.xz |
(svn r22659) -Add: [NewGRF] Support for the land slope check callback for stations.
Diffstat (limited to 'src/newgrf_commons.cpp')
-rw-r--r-- | src/newgrf_commons.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index 8b01c1268..83d1d4f44 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -413,9 +413,10 @@ uint32 GetTerrainType(TileIndex tile, TileContext context) * @param parameter The NewGRF "encoded" offset. * @param tile The tile to base the offset from. * @param signed_offsets Whether the offsets are to be interpreted as signed or not. + * @param axis Axis of a railways station. * @return The tile at the offset. */ -TileIndex GetNearbyTile(byte parameter, TileIndex tile, bool signed_offsets) +TileIndex GetNearbyTile(byte parameter, TileIndex tile, bool signed_offsets, Axis axis) { int8 x = GB(parameter, 0, 4); int8 y = GB(parameter, 4, 4); @@ -424,7 +425,8 @@ TileIndex GetNearbyTile(byte parameter, TileIndex tile, bool signed_offsets) if (signed_offsets && y >= 8) y -= 16; /* Swap width and height depending on axis for railway stations */ - if (HasStationTileRail(tile) && GetRailStationAxis(tile) == AXIS_Y) Swap(x, y); + if (axis == INVALID_AXIS && HasStationTileRail(tile)) axis = GetRailStationAxis(tile); + if (axis == AXIS_Y) Swap(x, y); /* Make sure we never roam outside of the map, better wrap in that case */ return TILE_MASK(tile + TileDiffXY(x, y)); |