16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 09:59:18 +02:00

build 191117. binary terrain subsystem state switch, minor bug fixes

This commit is contained in:
tmj-fstate
2019-11-18 04:18:44 +01:00
parent 14ab3fd3d7
commit e3dbaf9096
10 changed files with 23 additions and 9 deletions

View File

@@ -5557,19 +5557,20 @@ TController::UpdateSituation(double dt) {
VelDesired,
VelforDriver );
}
// recalculate potential load exchange duration
ExchangeTime = 0.f;
if( fStopTime < 0 ) {
// czas postoju przed dalszą jazdą (np. na przystanku)
VelDesired = 0.0; // jak ma czekać, to nie ma jazdy
// verify progress of load exchange
auto exchangetime { 0.f };
auto *vehicle { pVehicles[ 0 ] };
while( vehicle != nullptr ) {
exchangetime = std::max( exchangetime, vehicle->LoadExchangeTime() );
ExchangeTime = std::max( ExchangeTime, vehicle->LoadExchangeTime() );
vehicle = vehicle->Next();
}
if( ( exchangetime > 0 )
if( ( ExchangeTime > 0 )
|| ( mvOccupied->Vel > 2.0 ) ) { // HACK: force timer reset if the load exchange is cancelled due to departure
WaitingSet( exchangetime );
WaitingSet( ExchangeTime );
}
}