fix: Fixes tick count calculcations (#1366)
This commit is contained in:
parent
0645251ec7
commit
dda55889f6
9 changed files with 23 additions and 35 deletions
|
|
@ -39,21 +39,17 @@ public partial class NetState
|
|||
|
||||
var now = Core.TickCount;
|
||||
|
||||
var lastIndex = -1;
|
||||
|
||||
// Expire old steps
|
||||
while (_expiredIndex != _stepIndex)
|
||||
{
|
||||
var step = _steps[_expiredIndex];
|
||||
|
||||
// Is the step ahead of us, or the next step rolled over and we didn't yet
|
||||
if (step > now || lastIndex > -1 && _steps[lastIndex] > step)
|
||||
if (step - now > 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
lastIndex = _expiredIndex++;
|
||||
|
||||
if (_expiredIndex == stepsLength)
|
||||
{
|
||||
_expiredIndex -= stepsLength;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue