- fixed angle calculation in AdjustPlayerAngle for portals.

Normally this will adjust relative to the actual direction to the target, but with arbitrary portals that cannot be calculated so using the actual attack angle is the only option.
This commit is contained in:
Christoph Oelckers 2016-04-08 13:08:08 +02:00
parent 7404142edf
commit 74c9a7bf67

View file

@ -27,7 +27,11 @@ static FRandom pr_fpatk ("FPunchAttack");
void AdjustPlayerAngle (AActor *pmo, FTranslatedLineTarget *t)
{
DAngle difference = deltaangle(pmo->Angles.Yaw, pmo->AngleTo(t->linetarget));
// normally this will adjust relative to the actual direction to the target,
// but with arbitrary portals that cannot be calculated so using the actual
// attack angle is the only option.
DAngle atkangle = t->unlinked ? t->angleFromSource : pmo->AngleTo(t->linetarget);
DAngle difference = deltaangle(pmo->Angles.Yaw, atkangle);
if (fabs(difference) > MAX_ANGLE_ADJUST)
{
if (difference > 0)