From 107809d876cd6434f76d4aa76284a2cca2ca457a Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 13 Oct 2023 21:17:03 -0700 Subject: [PATCH] Loops: guarantee exit at exact intended angle --- src/p_loop.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/p_loop.c b/src/p_loop.c index 815a6aa61..12ef3d714 100644 --- a/src/p_loop.c +++ b/src/p_loop.c @@ -160,13 +160,18 @@ boolean P_PlayerOrbit(player_t *player) left = (s->max_revolution - s->revolution); - if (abs(left) < abs(step)) + if (left == 0) { P_ExitPlayerOrbit(player); return false; } + if (abs(left) < abs(step)) + { + step = left; + } + // If player slows down by too much, throw them out of // the loop in a tumble. if (player->speed < player->mo->scale)