Fix tram reversing on custom bridge head tiles.
This commit is contained in:
@@ -1113,7 +1113,7 @@ static Trackdir FollowPreviousRoadVehicle(const RoadVehicle *v, const RoadVehicl
|
||||
};
|
||||
RoadBits required = required_roadbits[dir & 0x07];
|
||||
|
||||
if ((required & GetAnyRoadBits(tile, v->roadtype, true)) == ROAD_NONE) {
|
||||
if ((required & GetAnyRoadBits(tile, v->roadtype, false)) == ROAD_NONE) {
|
||||
dir = INVALID_TRACKDIR;
|
||||
}
|
||||
|
||||
@@ -1367,7 +1367,7 @@ again:
|
||||
Trackdir dir;
|
||||
uint turn_around_start_frame = RVC_TURN_AROUND_START_FRAME;
|
||||
|
||||
if (v->roadtype == ROADTYPE_TRAM && !IsRoadDepotTile(v->tile) && HasExactlyOneBit(GetAnyRoadBits(v->tile, ROADTYPE_TRAM, true))) {
|
||||
if (v->roadtype == ROADTYPE_TRAM && !IsRoadDepotTile(v->tile) && HasExactlyOneBit(GetAnyRoadBits(v->tile, ROADTYPE_TRAM, false))) {
|
||||
/*
|
||||
* The tram is turning around with one tram 'roadbit'. This means that
|
||||
* it is using the 'big' corner 'drive data'. However, to support the
|
||||
|
@@ -2235,6 +2235,12 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
|
||||
|
||||
case VEH_ROAD: {
|
||||
RoadVehicle *rv = RoadVehicle::From(v);
|
||||
if (IsRoadCustomBridgeHeadTile(tile)) {
|
||||
RoadBits bits = ROAD_NONE;
|
||||
if (rv->compatible_roadtypes & ROADTYPES_TRAM) bits |= GetCustomBridgeHeadRoadBits(tile, ROADTYPE_TRAM);
|
||||
if (rv->compatible_roadtypes & ROADTYPES_ROAD) bits |= GetCustomBridgeHeadRoadBits(tile, ROADTYPE_ROAD);
|
||||
if (!(bits & DiagDirToRoadBits(GetTunnelBridgeDirection(tile)))) return VETSB_CONTINUE;
|
||||
}
|
||||
rv->cur_image_valid_dir = INVALID_DIR;
|
||||
rv->state = RVSB_WORMHOLE;
|
||||
/* There are no slopes inside bridges / tunnels. */
|
||||
|
Reference in New Issue
Block a user