Fix parameter shadowing in GetTrainStopLocation
This commit is contained in:
@@ -584,10 +584,10 @@ int GetTrainStopLocation(StationID station_id, TileIndex tile, Train *v, bool up
|
|||||||
/* Determine the non-diagonal direction in which we will exit this tile */
|
/* Determine the non-diagonal direction in which we will exit this tile */
|
||||||
DiagDirection dir = VehicleExitDir(front->direction, front->track);
|
DiagDirection dir = VehicleExitDir(front->direction, front->track);
|
||||||
/* Calculate next tile */
|
/* Calculate next tile */
|
||||||
TileIndex tile = front->tile + TileOffsByDiagDir(dir);
|
TileIndex next_tile = front->tile + TileOffsByDiagDir(dir);
|
||||||
|
|
||||||
/* Determine the track status on the next tile */
|
/* Determine the track status on the next tile */
|
||||||
TrackdirBits trackdirbits = GetTileTrackdirBits(tile, TRANSPORT_RAIL, 0, ReverseDiagDir(dir)) & DiagdirReachesTrackdirs(dir);
|
TrackdirBits trackdirbits = GetTileTrackdirBits(next_tile, TRANSPORT_RAIL, 0, ReverseDiagDir(dir)) & DiagdirReachesTrackdirs(dir);
|
||||||
|
|
||||||
/* mask unreachable track bits if we are forbidden to do 90deg turns */
|
/* mask unreachable track bits if we are forbidden to do 90deg turns */
|
||||||
TrackBits bits = TrackdirBitsToTrackBits(trackdirbits);
|
TrackBits bits = TrackdirBitsToTrackBits(trackdirbits);
|
||||||
@@ -595,8 +595,8 @@ int GetTrainStopLocation(StationID station_id, TileIndex tile, Train *v, bool up
|
|||||||
bits &= ~TrackCrossesTracks(FindFirstTrack(front->track));
|
bits &= ~TrackCrossesTracks(FindFirstTrack(front->track));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bits == TRACK_BIT_NONE || !CheckCompatibleRail(front, tile, dir) || IsRailDepotTile(tile) ||
|
if (bits == TRACK_BIT_NONE || !CheckCompatibleRail(front, next_tile, dir) || IsRailDepotTile(next_tile) ||
|
||||||
(KillFirstBit(trackdirbits) == TRACKDIR_BIT_NONE && HasOnewaySignalBlockingTrackdir(tile, FindFirstTrackdir(trackdirbits)))) {
|
(KillFirstBit(trackdirbits) == TRACKDIR_BIT_NONE && HasOnewaySignalBlockingTrackdir(next_tile, FindFirstTrackdir(trackdirbits)))) {
|
||||||
/* next tile is an effective dead end */
|
/* next tile is an effective dead end */
|
||||||
int current_platform_remaining = *station_ahead - TILE_SIZE + GetTileMarginInFrontOfTrain(v);
|
int current_platform_remaining = *station_ahead - TILE_SIZE + GetTileMarginInFrontOfTrain(v);
|
||||||
int limit = GetTileMarginInFrontOfTrain(front) + (*station_length - current_platform_remaining) - ((v->gcache.cached_veh_length + 1) / 2);
|
int limit = GetTileMarginInFrontOfTrain(front) + (*station_length - current_platform_remaining) - ((v->gcache.cached_veh_length + 1) / 2);
|
||||||
|
Reference in New Issue
Block a user