Okay, actually fixed. Thanks, MI, for understanding the maths a little better than I :p

This commit is contained in:
toasterbabe 2017-07-30 17:45:27 +01:00
parent 1e1d191a75
commit 021e7ed1f0

View file

@ -988,10 +988,14 @@ static boolean PIT_CheckThing(mobj_t *thing)
fixed_t bottomz, topz;
angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y);
if (P_PlayerInPain(tmthing->player)
&& (tmthing->momx || tmthing->momy)
&& (R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle) > ANGLE_180)
return true; // Yes, this is intentionally outside the z-height check. No standing on spikes whilst moving away from them.
if (P_PlayerInPain(tmthing->player) && (tmthing->momx || tmthing->momy))
{
angle_t playerangle = R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle;
if (playerangle > ANGLE_180)
playerangle = InvAngle(playerangle);
if (playerangle < ANGLE_90)
return true; // Yes, this is intentionally outside the z-height check. No standing on spikes whilst moving away from them.
}
bottomz = thing->z;
topz = thing->z + thing->height;