From 6b222c493534c28eeee10f34d3175ef6114e72eb Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 07:41:49 -0400 Subject: [PATCH] Fix wheels lingering after comeback --- src/p_mobj.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index f1c2b15e..6a9efc02 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9343,6 +9343,18 @@ void P_RemoveMobj(mobj_t *mobj) if (mobj->type == MT_SHADOW) P_RemoveShadow(mobj); + if (mobj->type == MT_KARMAHITBOX) + { + mobj_t *cur = mobj->hnext; + + while (cur && !P_MobjWasRemoved(cur)) + { + mobj_t *prev = cur; // Kind of a dumb var, but we need to set cur before we remove the mobj + cur = cur->hnext; + P_RemoveMobj(prev); + } + } + mobj->health = 0; // Just because // unlink from sector and block lists