From 2ce0c248ed74d91c117c73a28b8bd038bbb549db Mon Sep 17 00:00:00 2001 From: SMS Alfredo <65426124+SMS-Alfredo@users.noreply.github.com> Date: Wed, 31 May 2023 23:55:03 -0500 Subject: [PATCH] Make Dead / NoClipHeight Objects Immune to Death Pits --- src/p_mobj.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index eeaf54776..32bfb542a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2474,7 +2474,8 @@ boolean P_ZMovement(mobj_t *mo) break; } - if (!mo->player && P_CheckDeathPitCollide(mo)) + if (!mo->player && P_CheckDeathPitCollide(mo) && mo->health + && !(mo->flags & MF_NOCLIPHEIGHT) && !(mo->flags2 & MF2_BOSSDEAD)) { switch (mo->type) { @@ -2488,10 +2489,7 @@ boolean P_ZMovement(mobj_t *mo) if (mo->flags & MF_ENEMY || mo->flags & MF_BOSS || mo->type == MT_MINECART) { // Kill enemies, bosses and minecarts that fall into death pits. - if (mo->health) - { - P_KillMobj(mo, NULL, NULL, 0); - } + P_KillMobj(mo, NULL, NULL, 0); return !P_MobjWasRemoved(mo); // allows explosion states to run } else @@ -3137,7 +3135,8 @@ boolean P_SceneryZMovement(mobj_t *mo) break; } - if (P_CheckDeathPitCollide(mo)) + if (!mo->player && P_CheckDeathPitCollide(mo) && mo->health + && !(mo->flags & MF_NOCLIPHEIGHT) && !(mo->flags2 & MF2_BOSSDEAD)) { P_RemoveMobj(mo); return false;