Set IsFirstTimePredicted to false during state application (#3866)

This commit is contained in:
Leon Friedrich
2023-03-24 19:14:01 +13:00
committed by GitHub
parent 124c627fe2
commit eb3dfeaa7b
3 changed files with 5 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ END TEMPLATE-->
### Breaking changes
*None yet*
* `IGameTiming.IsFirstTimePredicted` is now false while applying game states.
### New features

View File

@@ -448,8 +448,7 @@ namespace Robust.Client.GameStates
PredictionNeedsResetting = false;
using var _ = _prof.Group("ResetPredictedEntities");
using var __ = _timing.StartPastPredictionArea();
using var ___ = _timing.StartStateApplicationArea();
using var __ = _timing.StartStateApplicationArea();
var countReset = 0;
var system = _entitySystemManager.GetEntitySystem<ClientDirtySystem>();

View File

@@ -73,11 +73,14 @@ namespace Robust.Client.Timing
public void StartStateApplication()
{
DebugTools.Assert(IsFirstTimePredicted, "Starting state application in the middle of a past prediction.");
IsFirstTimePredicted = false;
ApplyingState = true;
}
public void EndStateApplication()
{
IsFirstTimePredicted = true;
ApplyingState = false;
}
}