Make sure rocks spawned by the rock spawners despawn when they're on the floor and not moving

This commit is contained in:
Monster Iestyn 2017-02-03 18:47:20 +00:00
parent a29ced725d
commit 659a62db88

View file

@ -6648,6 +6648,17 @@ void P_MobjThinker(mobj_t *mobj)
}
else switch (mobj->type)
{
case MT_FALLINGROCK:
// Despawn rocks here in case zmovement code can't do so (blame slopes)
if (!mobj->momx && !mobj->momy && !mobj->momz
&& ((mobj->z <= mobj->floorz && !(mobj->eflags & MFE_VERTICALFLIP))
|| (mobj->z + mobj->height >= mobj->ceilingz && mobj->eflags & MFE_VERTICALFLIP)))
{
P_RemoveMobj(mobj);
return;
}
P_MobjCheckWater(mobj);
break;
case MT_EMERALDSPAWN:
if (mobj->threshold)
{