From: kraflab Date: Fri, 17 Nov 2023 16:27:43 +0100 Subject: [PATCH] Fix overflow hiding distant sprites --- prboom2/src/gl_main.c | 2 +- prboom2/src/r_things.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prboom2/src/gl_main.c b/prboom2/src/gl_main.c index 2989d6e4b..f1f9f1245 100644 --- a/prboom2/src/gl_main.c +++ b/prboom2/src/gl_main.c @@ -2176,7 +2176,7 @@ void gld_ProjectSprite(mobj_t* thing, int lightlevel) else { // too far off the side? - if (D_abs(tx) > (tz << 2)) + if (D_abs(tx) > ((int64_t) tz << 2)) return; } diff --git a/prboom2/src/r_things.c b/prboom2/src/r_things.c index d5282b2d8..cae632c12 100644 --- a/prboom2/src/r_things.c +++ b/prboom2/src/r_things.c @@ -708,7 +708,7 @@ static void R_ProjectSprite (mobj_t* thing, int lightlevel) tx = -(gyt+gxt); // too far off the side? - if (D_abs(tx)>(tz<<2)) + if (D_abs(tx) > ((int64_t) tz << 2)) return; // decide which patch to use for sprite relative to player -- 2.46.2