mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-19 01:29:21 +02:00
Ask the cell itself whether its command is still pending, guard the order table
The spent command was tracked in a table flag, which is lost whenever the speed table is rebuilt - the cell would go back to being a stop point. The memcell already knows: StopCommandSent() drops the pending flag and keeps the text, so the event now answers is_command_spent() and the table point follows it. OrderNextGet() read one past the end of OrderList when the current order sat in the last slot; it now reports Wait_for_orders there, which is what OrderNext() wraps to anyway.
This commit is contained in:
@@ -274,9 +274,10 @@ void TSpeedPos::CommandCheck()
|
||||
// inna komenda w evencie skanowanym powoduje zatrzymanie i wysłanie tej komendy
|
||||
// nie manewrowa, nie przystanek, nie zatrzymać na SBL
|
||||
// jak nieznana komenda w komórce sygnałowej, to zatrzymujemy
|
||||
// a cell keeps its text after the command has been delivered - going on standing in
|
||||
// front of it would make every command cell a permanent stop point
|
||||
fVelNext = ( ( iFlags & spCommandSent ) != 0 ? -1.0 : 0.0 );
|
||||
// a cell keeps its text after the command has been delivered, so asking the driver to
|
||||
// stand in front of it any longer would make every command cell a permanent stop point
|
||||
fVelNext = ( evEvent != nullptr && evEvent->is_command_spent() ? -1.0 : 0.0 );
|
||||
if( fVelNext < 0.0 ) { iFlags |= spCommandSent; }
|
||||
// TODO: check whether clearing spShuntSemaphor flag doesn't cause problems
|
||||
// potentially it can invalidate shunt semaphor used to transmit timetable or similar command
|
||||
iFlags &= ~(spShuntSemaphor | spPassengerStopPoint | spStopOnSBL);
|
||||
@@ -8525,9 +8526,6 @@ TController::check_route_ahead( double const Range ) {
|
||||
eSignNext->StopCommandSent(); // się wykonało już
|
||||
*/ // replacement of the above
|
||||
eSignNext->send_command( *this );
|
||||
for( auto &point : sSpeedTable ) {
|
||||
if( point.evEvent == eSignNext ) { point.iFlags |= spCommandSent; }
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user