Actually round movement.X down to zero

whoops
This commit is contained in:
juanjp600
2017-01-06 16:05:23 -03:00
parent f453980ace
commit 7dc474dab4
2 changed files with 7 additions and 1 deletions

View File

@@ -283,6 +283,11 @@ namespace Barotrauma
MathUtils.SmoothStep(movement, TargetMovement * walkSpeed, movementLerp) :
overrideTargetMovement;
if (Math.Abs(movement.X) < 0.005f)
{
movement.X = 0.0f;
}
movement.Y = 0.0f;
for (int i = 0; i < 2; i++)
@@ -489,6 +494,7 @@ namespace Barotrauma
{
movement = Vector2.Normalize(movement);
}
if (Math.Abs(movement.X)<0.005f)
{
movement.X = 0.0f;

View File

@@ -1358,7 +1358,7 @@ namespace Barotrauma
TransformCursorPos();
if (dequeuedInput == InputNetFlags.None && Math.Abs(AnimController.movement.X) < 0.005f && Math.Abs(AnimController.movement.Y) < 0.005f)
if (dequeuedInput == InputNetFlags.None && Math.Abs(AnimController.Collider.LinearVelocity.X) < 0.005f && Math.Abs(AnimController.Collider.LinearVelocity.Y) < 0.005f)
{
while (memInput.Count > 5 && memInput[memInput.Count - 1] == 0)
{