Merge branch 'fix-sealed-star-emerald-die' into 'master'

Fix UFO Catcher Emerald dying on death pits -- also a general fix to death pits

Closes #608

See merge request KartKrew/Kart!1497
This commit is contained in:
Oni 2023-09-17 05:22:21 +00:00
commit a0a1ef41e2

View file

@ -2194,12 +2194,11 @@ boolean P_CheckDeathPitCollide(mobj_t *mo)
const boolean flipped = (mo->eflags & MFE_VERTICALFLIP);
const sectorflags_t flags = mo->subsector->sector->flags;
return (
(mo->z <= mo->subsector->sector->floorheight
&& ((flags & MSF_TRIGGERSPECIAL_HEADBUMP) || !flipped) && (flags & MSF_FLIPSPECIAL_FLOOR))
|| (mo->z + mo->height >= mo->subsector->sector->ceilingheight
&& ((flags & MSF_TRIGGERSPECIAL_HEADBUMP) || flipped) && (flags & MSF_FLIPSPECIAL_CEILING))
);
if (((flags & MSF_TRIGGERSPECIAL_HEADBUMP) || !flipped) && (flags & MSF_FLIPSPECIAL_FLOOR))
return (mo->z <= P_GetSpecialBottomZ(mo, mo->subsector->sector, mo->subsector->sector));
if (((flags & MSF_TRIGGERSPECIAL_HEADBUMP) || flipped) && (flags & MSF_FLIPSPECIAL_CEILING))
return (mo->z + mo->height >= P_GetSpecialTopZ(mo, mo->subsector->sector, mo->subsector->sector));
}
return false;
@ -2312,7 +2311,7 @@ boolean P_ZMovement(mobj_t *mo)
break;
case MT_EMERALD:
if (P_CheckDeathPitCollide(mo))
if (!(mo->flags & MF_NOCLIPHEIGHT) && P_CheckDeathPitCollide(mo))
{
P_RemoveMobj(mo);
return false;