equal
deleted
inserted
replaced
605 * @param subtype For TRANSPORT_ROAD the compatible RoadTypes of the vehicle. |
605 * @param subtype For TRANSPORT_ROAD the compatible RoadTypes of the vehicle. |
606 * @return The Trackdirs the vehicle can continue moving on. |
606 * @return The Trackdirs the vehicle can continue moving on. |
607 */ |
607 */ |
608 static TrackdirBits GetDriveableTrackdirBits(TileIndex dst_tile, Trackdir src_trackdir, TransportType type, uint subtype) |
608 static TrackdirBits GetDriveableTrackdirBits(TileIndex dst_tile, Trackdir src_trackdir, TransportType type, uint subtype) |
609 { |
609 { |
610 uint32 ts = GetTileTrackStatus(dst_tile, type, subtype); |
610 TrackdirBits trackdirbits = TrackStatusToTrackdirBits(GetTileTrackStatus(dst_tile, type, subtype)); |
611 TrackdirBits trackdirbits = (TrackdirBits)(ts & TRACKDIR_BIT_MASK); |
|
612 |
611 |
613 if (trackdirbits == 0 && type == TRANSPORT_ROAD && HasBit(subtype, ROADTYPE_TRAM)) { |
612 if (trackdirbits == 0 && type == TRANSPORT_ROAD && HasBit(subtype, ROADTYPE_TRAM)) { |
614 /* GetTileTrackStatus() returns 0 for single tram bits. |
613 /* GetTileTrackStatus() returns 0 for single tram bits. |
615 * As we cannot change it there (easily) without breaking something, change it here */ |
614 * As we cannot change it there (easily) without breaking something, change it here */ |
616 switch (GetSingleTramBit(dst_tile)) { |
615 switch (GetSingleTramBit(dst_tile)) { |