File tree Expand file tree Collapse file tree
com.unity.netcode.gameobjects/Tests/Editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,15 +131,19 @@ public void StandingStillDoesNotChangeWhatIsSent()
131131 var lossOnArrival = deltaPosition . PrecisionLossDelta ;
132132 Assert . AreNotEqual ( 0.0f , lossOnArrival . x , "The arrival conversion has to leave rounding loss behind." ) ;
133133
134+ var currentTick = k_Tick + 2 ;
135+ var maxTick = k_Tick + 5 ;
136+
134137 // Folding the loss back in while stationary is what made resting objects jitter.
135- for ( var tick = k_Tick + 2 ; tick <= k_Tick + 5 ; tick ++ )
138+ while ( currentTick <= maxTick )
136139 {
137- deltaPosition . UpdateFrom ( ref arrived , tick ) ;
140+ deltaPosition . UpdateFrom ( ref arrived , currentTick ) ;
138141
139142 Assert . AreEqual ( encodedOnArrival , Encoded ( deltaPosition ) ,
140- $ "The transmitted delta changed on tick { tick } while the position did not move.") ;
143+ $ "The transmitted delta changed on tick { currentTick } while the position did not move.") ;
141144 Assert . AreEqual ( lossOnArrival , deltaPosition . PrecisionLossDelta ,
142- $ "The carried loss should be untouched on tick { tick } so it still applies once movement resumes.") ;
145+ $ "The carried loss should be untouched on tick { currentTick } so it still applies once movement resumes.") ;
146+ currentTick ++ ;
143147 }
144148 }
145149
You can’t perform that action at this time.
0 commit comments