- floatified p_scroll.cpp

While testing this it became clear that with the higher precision of doubles it has to be avoided at all costs to compare an actor's z position with a value retrieved from ZatPoint to check if it is standing on a floor. There can be some minor variations, depending on what was done with this value. Added isAbove, isBelow and isAtZ checking methods to AActor which properly deal with the problem.
This commit is contained in:
Christoph Oelckers 2016-03-28 21:04:46 +02:00
commit 05504b65d2
8 changed files with 105 additions and 73 deletions

View file

@ -2992,7 +2992,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, DVector2 &move)
}
else if (t > 0)
{ // Desired location is in front of (above) the plane
if (fabs(planezhere - actor->Z() < (1/65536.))) // it is very important not to be too precise here.
if (actor->isAtZ(planezhere)) // it is very important not to be too precise here.
{
// Actor's current spot is on/in the plane, so walk down it
// Same principle as walking up, except reversed