Obj_SneakerPanelSetup: call P_CheckPosition directly and manually set standingslope

- P_TryMove may fail for STEP UP (ooooh, scary) reasons
This commit is contained in:
James R 2023-12-23 09:34:35 -08:00
parent 8dc35c0fe3
commit 244cb1759d

View file

@ -44,7 +44,21 @@ void Obj_SneakerPanelSetup(mobj_t *mobj, mapthing_t *mthing)
mobj->eflags |= MFE_VERTICALFLIP;
mobj->flags2 |= MF2_OBJECTFLIP;
}
P_TryMove(mobj, mobj->x, mobj->y, true, NULL); // sets standingslope
if (P_CheckPosition(mobj, mobj->x, mobj->y, NULL))
{
if (P_IsObjectFlipped(mobj))
{
if (tm.ceilingz <= mobj->z + mobj->height)
mobj->standingslope = tm.ceilingslope;
}
else
{
if (mobj->z <= tm.floorz)
mobj->standingslope = tm.floorslope;
}
}
Obj_SneakerPanelSpriteScale(mobj);
}