From 74c9a7bf67378e3ba32d64249b747607c2f44e7d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 8 Apr 2016 13:08:08 +0200 Subject: [PATCH] - 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. --- src/g_hexen/a_fighterplayer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/g_hexen/a_fighterplayer.cpp b/src/g_hexen/a_fighterplayer.cpp index 607a9a88a..c8f3aa19f 100644 --- a/src/g_hexen/a_fighterplayer.cpp +++ b/src/g_hexen/a_fighterplayer.cpp @@ -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)