From 263b73be389b3fe4586c7102ce229d0fac6d9534 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 18 Nov 2023 21:56:32 -0700 Subject: [PATCH] Capsule followrs use target flags if no source (fixes crash) --- src/p_inter.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index fe3045fb4..25999d960 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2150,9 +2150,19 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget cur->scalespeed = cur->destscale/TICRATE; cur->z -= cur->height/2; - // flags are NOT from the target - just in case it's just been placed on the ceiling as a gimmick - cur->flags2 |= (source->flags2 & MF2_OBJECTFLIP); - cur->eflags |= (source->eflags & MFE_VERTICALFLIP); + if (source && !P_MobjWasRemoved(source)) + { + // flags are NOT from the target - just in case it's just been placed on the ceiling as a gimmick + cur->flags2 |= (source->flags2 & MF2_OBJECTFLIP); + cur->eflags |= (source->eflags & MFE_VERTICALFLIP); + } + else + { + // Welp, nothing to be done here + cur->flags2 |= (target->flags2 & MF2_OBJECTFLIP); + cur->eflags |= (target->eflags & MFE_VERTICALFLIP); + } + launchangle = FixedAngle( (