diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index e2b09d8f7..c3fb1bb47 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -289,7 +289,7 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool fixed_t horizDelta = pp->horizTarget - pp->q16horiz; pp->q16horiz += xs_CRoundToInt(scaleAdjust * horizDelta); - if (abs(pp->q16horiz) >= abs(horizDelta)) + if (abs(pp->q16horiz - pp->horizTarget) < FRACUNIT) { pp->q16horiz = pp->horizTarget; pp->horizTarget = 0; @@ -310,7 +310,7 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool fixed_t angDelta = GetDeltaQ16Angle(pp->angTarget, pp->q16ang); pp->q16ang = (pp->q16ang + xs_CRoundToInt(scaleAdjust * angDelta)); - if (pp->q16ang >= pp->angTarget) + if (abs(pp->q16ang - pp->angTarget) < FRACUNIT) { pp->q16ang = pp->angTarget; pp->angTarget = 0; diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 297967f07..52e429a0d 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -7817,7 +7817,7 @@ void playerSetAngle(PLAYERp pp, double ang) ang += 0.1; } - pp->angTarget = pp->q16ang + GetDeltaQ16Angle(ang, pp->q16ang); + pp->angTarget = pp->q16ang + GetDeltaQ16Angle(FloatToFixed(ang), pp->q16ang); } else {