Skip to content

Commit

Permalink
Fix simulator running every frame
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyDuchess committed Jul 6, 2024
1 parent 7574a9b commit 2df0533
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Assets/Scripts/OpenTS2/Game/Simulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ private void Update()
{
_timer += Time.deltaTime;
var timesToTick = Mathf.FloorToInt(_timer / TickRate);
_virtualMachine.Tick();
for (var i = 0; i < timesToTick; i++)
{
_virtualMachine.Tick();
}
_timer -= timesToTick * TickRate;
}

Expand Down

0 comments on commit 2df0533

Please sign in to comment.