mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-19 03:49:19 +02:00
Stop cutting the forward scan short at an occupied track.
The check added to TableTraceRoute() decided consist membership through BelongsToConsist(), which falls back on TDynamicObject::is_connected() and its Next()/Prev() walk - the same pair that mishandles reversed members. When it failed to recognise one of our own cars the scan ended on our own consist, no signal ever reached the speed table, and the driver stood at a clear semaphore for good. Seen on a shunting locomotive that had just uncoupled, with ctOwner still cleared. The signal-permission code does not need it: OtherConsistAtSignal() looks the route over on its own and DistanceToAnotherConsist() measures to the vehicle rather than to the end of a track. Both stay.
This commit is contained in:
@@ -744,16 +744,6 @@ void TController::TableTraceRoute(double fDistance, TDynamicObject *pVehicle)
|
||||
}
|
||||
}
|
||||
|
||||
auto const distancetotrackend{ fCurrentDistance + fTrackLength };
|
||||
// sign of the distance encodes the scanning direction (fLastDir < 0 = towards Point2)
|
||||
if( distancetotrackend > 0.0 // the track still reaches ahead of us
|
||||
&& IsOccupiedByAnotherConsist( pTrack, distancetotrackend * ( fLastDir < 0.0 ? 1.0 : -1.0 ) ) ) {
|
||||
// another consist stands here: it owns the signals beyond it, so we scan no further. The track
|
||||
// stays in the table, marked checked - scanning resumes from the last entry, no dup control
|
||||
tLast = pTrack;
|
||||
break;
|
||||
}
|
||||
|
||||
fCurrentDistance += fTrackLength; // doliczenie kolejnego odcinka do przeskanowanej długości
|
||||
tLast = pTrack; // odhaczenie, że sprawdzony
|
||||
fLastVel = pTrack->VelocityGet(); // prędkość na poprzednio sprawdzonym odcinku
|
||||
|
||||
Reference in New Issue
Block a user