src/station_cmd.cpp
changeset 9092 383a632de666
parent 9070 e83a2f017f3d
child 9112 ec6800eaa340
equal deleted inserted replaced
9091:c1cddeb8511c 9092:383a632de666
  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;