diff options
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r-- | src/newgrf_station.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 7eaf6164b..626e50821 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -426,12 +426,11 @@ static uint32 StationGetVariable(const ResolverObject *object, byte variable, by Axis axis = GetRailStationAxis(tile); if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required - byte tile_type = GetTerrainType(tile) << 2 | (IsTileType(tile, MP_WATER) ? 1 : 0) << 1; - uint z; - Slope tileh = GetTileSlope(tile, &z); - bool swap = (axis == AXIS_Y && HasBit(tileh, 0) != HasBit(tileh, 2)); - return GetTileType(tile) << 24 | z << 16 | tile_type << 8 | (tileh ^ (swap ? 5 : 0)); + Slope tileh = GetTileSlope(tile, NULL); + bool swap = (axis == AXIS_Y && HasBit(tileh, SLOPE_W) != HasBit(tileh, SLOPE_E)); + + return GetNearbyTileInformation(tile) ^ (swap ? SLOPE_EW : 0); } case 0x68: { // Station info of nearby tiles |