Small fix to elapse time function.

This commit is contained in:
Axel1092 2020-07-03 16:51:35 +02:00 committed by Axel1092
parent 780f0fe460
commit 5ccaa39d60
1 changed files with 6 additions and 2 deletions

View File

@ -35,9 +35,12 @@ void ATrafficLightGroup::ResetGroup()
Controller->ResetState(); Controller->ResetState();
} }
CurrentController = 0; CurrentController = 0;
if(Controllers.Num() > 0) { if(Controllers.Num() > 0)
{
Timer = Controllers[CurrentController]->NextState(); Timer = Controllers[CurrentController]->NextState();
} else { }
else
{
Timer = 0.0f; Timer = 0.0f;
} }
CurrentStateTimer = Timer; CurrentStateTimer = Timer;
@ -94,6 +97,7 @@ void ATrafficLightGroup::NextCycleStep()
else else
{ {
Timer = controller->NextState(); Timer = controller->NextState();
CurrentStateTimer = Timer;
} }
} }