From c3f7c26708f4347f4b1e3073105ab8dfaecefa4e Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 19 May 2019 03:55:49 +0000 Subject: [PATCH] Sanitize A_GetFurthestAngle() return value git-svn-id: https://svn.eduke32.com/eduke32@7669 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gameexec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index e9a060a42..410f09c75 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -318,7 +318,7 @@ int A_GetFurthestAngle(int const spriteNum, int const angDiv) auto const pSprite = (uspriteptr_t)&sprite[spriteNum]; if (pSprite->picnum != APLAYER && (AC_COUNT(actor[spriteNum].t_data)&63) > 2) - return pSprite->ang + 1024; + return (pSprite->ang + 1024) & 2047; int furthestAngle = 0; int const angIncs = tabledivide32_noinline(2048, angDiv);