From 39a5da5036341b789f65d573a6e03b369fab2c86 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 22 Dec 2024 01:31:00 +0100 Subject: [PATCH] use P_MobjWasRemoved and null check for thing subsector in projectsprite --- src/hardware/hw_main.c | 2 +- src/r_things.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 4511aff0f..8a3f66a15 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4478,7 +4478,7 @@ static void HWR_ProjectSprite(mobj_t *thing) angle_t sliptiderollangle = 0; #endif - if (!thing) + if (P_MobjWasRemoved(thing) || thing->subsector == NULL) return; // uncapped/interpolation diff --git a/src/r_things.c b/src/r_things.c index 18898855d..0feacb0af 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1178,6 +1178,7 @@ static void R_ProjectSprite(mobj_t *thing) //SoM: 3/17/2000 fixed_t gz, gzt; INT32 heightsec, phs; + INT32 dist = -1; INT32 light = 0; lighttable_t **lights_array = spritelights; fixed_t this_scale; @@ -1194,7 +1195,8 @@ static void R_ProjectSprite(mobj_t *thing) angle_t sliptiderollangle = 0; #endif - INT32 dist = -1; + if (P_MobjWasRemoved(thing) || thing->subsector == NULL) + return; if (cv_maxinterpdist.value) dist = R_QuickCamDist(thing->x, thing->y);