comparison src/station_cmd.cpp @ 8596:ae0c04ca28d2 draft

(svn r12177) -Codechange: use 'side' parameter in GetTileTrackStatus so there can be less checks in pathfinders for depots/stations/tunnels/bridges
author smatz <smatz@openttd.org>
date Mon, 18 Feb 2008 16:11:31 +0000
parents a34203ecde25
children 9e46ac001a8c
comparison
equal deleted inserted replaced
8595:1a405a547734 8596:ae0c04ca28d2
2278 } 2278 }
2279 td->str = str; 2279 td->str = str;
2280 } 2280 }
2281 2281
2282 2282
2283 static uint32 GetTileTrackStatus_Station(TileIndex tile, TransportType mode, uint sub_mode) 2283 static uint32 GetTileTrackStatus_Station(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
2284 { 2284 {
2285 switch (mode) { 2285 switch (mode) {
2286 case TRANSPORT_RAIL: 2286 case TRANSPORT_RAIL:
2287 if (IsRailwayStation(tile) && !IsStationTileBlocked(tile)) { 2287 if (IsRailwayStation(tile) && !IsStationTileBlocked(tile)) {
2288 return TrackToTrackBits(GetRailStationTrack(tile)) * 0x101; 2288 return TrackToTrackBits(GetRailStationTrack(tile)) * 0x101;
2300 return uint32(ts) * 0x101; 2300 return uint32(ts) * 0x101;
2301 } 2301 }
2302 break; 2302 break;
2303 2303
2304 case TRANSPORT_ROAD: 2304 case TRANSPORT_ROAD:
2305 if ((GetRoadTypes(tile) & sub_mode) != 0 && IsRoadStopTile(tile)) { 2305 if ((GetRoadTypes(tile) & sub_mode) != 0 && IsRoadStop(tile)) {
2306 return AxisToTrackBits(DiagDirToAxis(GetRoadStopDir(tile))) * 0x101; 2306 DiagDirection dir = GetRoadStopDir(tile);
2307 Axis axis = DiagDirToAxis(dir);
2308
2309 if (side != INVALID_DIAGDIR) {
2310 if (axis != DiagDirToAxis(side) || (IsStandardRoadStopTile(tile) && dir != side)) return 0;
2311 }
2312
2313 return AxisToTrackBits(axis) * 0x101;
2307 } 2314 }
2308 break; 2315 break;
2309 2316
2310 default: 2317 default:
2311 break; 2318 break;