Probably fix moonwalking?

This commit is contained in:
Pieter-Jan Briers
2020-07-08 01:28:49 +02:00
parent 271945e1a5
commit c25c1e1094

View File

@@ -189,11 +189,16 @@ namespace Content.Shared.GameObjects.Components.Movement
_lastInputSubTick = 0;
}
var fraction = (subTick - _lastInputSubTick) / (float) ushort.MaxValue;
if (_lastInputSubTick >= subTick)
{
var fraction = (subTick - _lastInputSubTick) / (float) ushort.MaxValue;
ref var lastMoveAmount = ref Sprinting ? ref _curTickSprintMovement : ref _curTickWalkMovement;
ref var lastMoveAmount = ref Sprinting ? ref _curTickSprintMovement : ref _curTickWalkMovement;
lastMoveAmount += DirVecForButtons(_heldMoveButtons) * fraction;
lastMoveAmount += DirVecForButtons(_heldMoveButtons) * fraction;
_lastInputSubTick = subTick;
}
if (enabled)
{
@@ -204,8 +209,6 @@ namespace Content.Shared.GameObjects.Components.Movement
_heldMoveButtons &= ~bit;
}
_lastInputSubTick = subTick;
Dirty();
}