FS#3345 - PBS paths not linked to trains on bridges.

Attached to Project: OpenTTD
Opened by Hirundo (Hirundo) - Thursday, 03 December 2009, 15:30 GMT
Last edited by frosch (frosch) - Thursday, 03 December 2009, 18:45 GMT
Type Bug
Category Vehicles → PBS
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Tested in r18387.

See the attached savegame. Demolish the tile between the arrows to see the bug in action.

When a part of a reserved path is demolished or otherwise changed, the entire path of the vehicle is unreserved. To do this GetTrainForReservation is used. This function fails to find the correct train when the train is on a bridge. This causes leftover reservations that don't belong to any vehicle. If reserved paths aren't shown, this could be very confusing to the user.

Attached is a hg diff that fixes the problem for me. However, I don't know the code intimately enough to make sure that there aren't any side effects.
This task depends upon

Closed by  frosch (frosch)
Thursday, 03 December 2009, 18:45 GMT
Reason for closing:  Fixed
Additional comments about closing:  in r18392. Thanks for patch :)