Skip to content

Commit 7414be3

Browse files
authored
fix: storing precise tick information when constructing ticks, to avoid missing/extraneous ticks (#1909)
1 parent 46a4854 commit 7414be3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

com.unity.netcode.gameobjects/Runtime/Timing/NetworkTime.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ public NetworkTime(uint tickRate, int tick, double tickOffset = 0d)
8181
: this(tickRate)
8282
{
8383
Assert.IsTrue(tickOffset < 1d / tickRate);
84-
this += tick * m_TickInterval + tickOffset;
84+
85+
m_CachedTickOffset = tickOffset;
86+
m_CachedTick = tick;
87+
m_TimeSec = tick * m_TickInterval + tickOffset;
8588
}
8689

8790
/// <summary>

0 commit comments

Comments
 (0)