shithub: choc

Download patch

ref: 8fc4e10f01a7c216163a9b607435afb44959aa8a
parent: 2d6a5bc38cd071336395e1f507053243c5434d0b
author: Fabian Greffrath <[email protected]>
date: Mon Jan 28 05:00:38 EST 2019

heretic: replace shifted negative value with negative of shifted value

This fixes a "Shifting a negative value is undefined behaviour"
cppcheck error.

--- a/src/heretic/r_things.c
+++ b/src/heretic/r_things.c
@@ -1006,7 +1006,7 @@
 //
 // Added for the sideviewing with an external device
     if (viewangleoffset <= 1024 << ANGLETOFINESHIFT || viewangleoffset >=
-        -1024 << ANGLETOFINESHIFT)
+        -(1024 << ANGLETOFINESHIFT))
     {                           // don't draw on side views
         R_DrawPlayerSprites();
     }