- CBF_DROPOFF Fixes

- Fixed: CBF_DROPOFF didn't actually check the coordinates passed to it for dropoff height values. It only checked to see if it was stuck in lines.
This commit is contained in:
MajorCooke 2016-04-09 14:44:17 -05:00 committed by Christoph Oelckers
commit 8b8c879994
3 changed files with 17 additions and 4 deletions

View file

@ -2410,7 +2410,7 @@ bool P_TryMove(AActor *thing, const DVector2 &pos,
//
//==========================================================================
bool P_CheckMove(AActor *thing, const DVector2 &pos)
bool P_CheckMove(AActor *thing, const DVector2 &pos, bool dropoff)
{
FCheckPosition tm;
double newz = thing->Z();
@ -2469,6 +2469,17 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos)
return false;
}
}
else if (dropoff)
{
const DVector3 oldpos = thing->Pos();
thing->SetOrigin(pos.X, pos.Y, newz, true);
bool hcheck = (newz - thing->MaxDropOffHeight > thing->floorz);
thing->SetOrigin(oldpos, true);
if (hcheck && !(thing->flags & MF_FLOAT) && !(i_compatflags & COMPATF_DROPOFF))
{
return false;
}
}
}
if (thing->flags2 & MF2_CANTLEAVEFLOORPIC