From e36da645d93e80601c7ce5aaa0b5061e2ec81441 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 25 Sep 2020 15:15:30 +0100 Subject: [PATCH] Revert a bruh moment from 2.2's development where, in order to fix statues and spikes from being visible on the death pit in CEZ, I made any object that comes into contact with a death pit and isn't on a whitelist delete itself. (Now the Chao at the start of Sonic Speedway don't die immediately.) --- src/p_mobj.c | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 15acc1cb7..2ac3750bb 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2174,30 +2174,14 @@ boolean P_ZMovement(mobj_t *mo) if (!mo->player && P_CheckDeathPitCollide(mo)) { - switch (mo->type) + if (mo->flags & MF_ENEMY || mo->flags & MF_BOSS || mo->type == MT_MINECART) { - case MT_GHOST: - case MT_METALSONIC_RACE: - case MT_EXPLODE: - case MT_BOSSEXPLODE: - case MT_SONIC3KBOSSEXPLODE: - break; - default: - 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, DMG_NORMAL); - } - return false; - } - else - { - P_RemoveMobj(mo); - return false; - } - break; + // Kill enemies, bosses and minecarts that fall into death pits. + if (mo->health) + { + P_KillMobj(mo, NULL, NULL, DMG_NORMAL); + } + return false; } } @@ -2797,12 +2781,6 @@ boolean P_SceneryZMovement(mobj_t *mo) break; } - if (P_CheckDeathPitCollide(mo)) - { - P_RemoveMobj(mo); - return false; - } - // clip movement if (((mo->z <= mo->floorz && !(mo->eflags & MFE_VERTICALFLIP)) || (mo->z + mo->height >= mo->ceilingz && mo->eflags & MFE_VERTICALFLIP))