FS#6039 - Signals: train gets stuck while entering a depot and path re-reservation occurs

Attached to Project: OpenTTD
Opened by Grzegorz Duczyński (adf88) - Sunday, 08 June 2014, 20:44 GMT
Last edited by andythenorth (andythenorth) - Thursday, 31 August 2017, 08:04 GMT
Type Bug
Category Core
Status Confirmed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version Version?
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


1. Send a train to a depot
2. While the train is entering the depot, initiate path re-reservation e.g. put a PBS on a near track
3. The train gets sucked

The problem seems to be inside TryPathReserve function, especially the fragment starting at this line:

Reservation fails because the depot is already reserved for a train. But it's the same train :) Looks like someone made wrong assumption that "v->track == TRACK_BIT_DEPOT" means that whole train is inside and wants to exit.
   a.png (60.6 KiB)
   b.png (63.9 KiB)
This task depends upon

Comment by Grzegorz Duczyński (adf88) - Sunday, 08 June 2014, 20:54 GMT
I'm not sure about origins of the bug but maybe the depot reservation status should have been already cleared while inside TryPathReserve? Just a thought...
Comment by andythenorth (andythenorth) - Thursday, 31 August 2017, 08:05 GMT
I confirmed this in FS#6046