From f0787077e395920ec2461e99c6432b287ace7cc2 Mon Sep 17 00:00:00 2001
From: GoldenTails <milestailsprower101n2@gmail.com>
Date: Mon, 22 Jun 2020 04:14:42 -0500
Subject: [PATCH] More people ought to know what modulo is...

Or modulous if your prefer.
---
 src/p_spec.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/p_spec.c b/src/p_spec.c
index e452203454..6f5eba4c41 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -2964,10 +2964,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
 					INT32 aim;
 
 					aim = sides[line->sidenum[0]].textureoffset>>FRACBITS;
-					while (aim < 0)
-						aim += 360;
-					while (aim >= 360)
-						aim -= 360;
+					aim = (aim + 360) % 360;
 					aim *= (ANGLE_90>>8);
 					aim /= 90;
 					aim <<= 8;
-- 
GitLab