diff options
author | frosch <frosch@openttd.org> | 2008-01-31 17:46:08 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-01-31 17:46:08 +0000 |
commit | 90ee6a16ab499135691fc0be395555d69e0c620e (patch) | |
tree | 938c7be67dc7eb597b5484394eaaf2db1f9b663a /src/newgrf_station.cpp | |
parent | 67e5fc5718940dfe06caa97e6bcbf870e9fb2a1c (diff) | |
download | openttd-90ee6a16ab499135691fc0be395555d69e0c620e.tar.xz |
(svn r12028) -Codechange: Split common part of station var 0x67, house var 0x62, indtile var 0x60 and industry var 0x62 to 'newgrf_commons.cpp'.
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 |