Update mobj floorz/ceilingz after FOF destruction

This commit is contained in:
spherallic 2023-03-16 12:12:58 +01:00
parent b5c3b30f13
commit 1a6e48de1e

View file

@ -1212,6 +1212,19 @@ static boolean T_SectorHasEnemies(sector_t *sec)
return false;
}
static void T_UpdateMobjPlaneZ(sector_t *sec)
{
msecnode_t *node = sec->touching_thinglist; // things touching this sector
mobj_t *mo;
while (node)
{
mo = node->m_thing;
mo->floorz = P_FloorzAtPos(mo->x, mo->y, mo->z, mo->height);
mo->ceilingz = P_CeilingzAtPos(mo->x, mo->y, mo->z, mo->height);
node = node->m_thinglist_next;
}
}
//
// T_NoEnemiesThinker
//
@ -1938,6 +1951,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
// no longer exists (can't collide with again)
rover->fofflags &= ~FOF_EXISTS;
rover->master->frontsector->moved = true;
T_UpdateMobjPlaneZ(sec); // prevent objects from floating
P_RecalcPrecipInSector(sec);
}