1
0
Fork 0

Fix #11528: Fixed edge case when starting drag from bridge ramp.

pull/13861/head
John Taylor 2025-03-22 22:01:27 +01:00
parent 895c8c6a61
commit 235c6e2c55
1 changed files with 2 additions and 2 deletions

View File

@ -891,11 +891,11 @@ static CommandCost CmdRailTrackHelper(DoCommandFlags flags, TileIndex tile, Tile
CommandCost last_error = CMD_ERROR;
for (;;) {
/* Check if hopping bridge/tunnel (#11528). */
if (!first_tile && wormhole_end == INVALID_TILE && IsDiagonalTrackdir(trackdir) && GetTileType(tile) == MP_TUNNELBRIDGE && GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) {
if (wormhole_end == INVALID_TILE && IsDiagonalTrackdir(trackdir) && GetTileType(tile) == MP_TUNNELBRIDGE && GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL) {
/* If the building direction is the same as the bridge/tunnel direction, skip building tracks until the bridge/tunnel ends. */
if (GetTunnelBridgeDirection(tile) == TrackdirToExitdir(trackdir)) {
wormhole_end = GetOtherTunnelBridgeEnd(tile);
} else if (GetTunnelBridgeDirection(tile) == TrackdirToExitdir(ReverseTrackdir(trackdir))) {
} else if (!first_tile && GetTunnelBridgeDirection(tile) == TrackdirToExitdir(ReverseTrackdir(trackdir))) {
break; // Upon running into a bridge ramp from the underside, we should stop building tracks.
}
}