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 | fe9891c8ec0376a3a79195ee2bd76bba317865a5 (patch) | |
tree | 938c7be67dc7eb597b5484394eaaf2db1f9b663a /src/newgrf_station.cpp | |
parent | ef35cefddc94539174c490e4e0bbe04a5a9d3dc8 (diff) | |
download | openttd-fe9891c8ec0376a3a79195ee2bd76bba317865a5.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 |