Train View - Cancel any pending start on disconnect

This commit is contained in:
Ale Martinez
2021-05-07 10:46:05 -03:00
parent 79f4bb2815
commit 0a03aac7e8

View File

@@ -1558,6 +1558,12 @@ void TrainSidebar::Connect()
void TrainSidebar::Disconnect()
{
// cancel any pending start
if (secs_to_start > 0) {
secs_to_start = 0;
start_timer->stop();
}
// don't try to disconnect if running or not connected
if ((status&RT_RUNNING) || ((status&RT_CONNECTED) == 0)) return;