Merge branch 'bustablemobjzfix' into 'next'

Update mobj floorz/ceilingz after a bustable FOF is destroyed

See merge request STJr/SRB2!1945
This commit is contained in:
Logan Aerl Arias 2024-01-01 04:44:09 +00:00
commit 050da08c15

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
//
@ -1941,6 +1954,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);
}