Skip to content

Commit f3d564e

Browse files
fix
Minor fix for an issue when dividing up the smooth damp and lerp buffer consumption.
1 parent ccd5026 commit f3d564e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,8 @@ private void InternalReset(T targetValue, double serverTime, bool isAngularValue
225225
/// <param name="maxDeltaTime">maximum time delta which defines the maximum time duration when consuming more than one item from the buffer</param>
226226
private void TryConsumeFromBuffer(double renderTime, float minDeltaTime, float maxDeltaTime)
227227
{
228-
var canGetNextItem = InterpolateState.TargetTimeAproximatelyReached() || IsAproximately(InterpolateState.CurrentValue, InterpolateState.Target.Value.Item);
229-
230-
if (!InterpolateState.Target.HasValue || (InterpolateState.Target.Value.TimeSent <= renderTime && canGetNextItem))
228+
if (!InterpolateState.Target.HasValue || (InterpolateState.Target.Value.TimeSent <= renderTime &&
229+
(InterpolateState.TargetTimeAproximatelyReached() || IsAproximately(InterpolateState.CurrentValue, InterpolateState.Target.Value.Item))))
231230
{
232231
BufferedItem? previousItem = null;
233232
var startTime = 0.0;

0 commit comments

Comments
 (0)