From 39d2945016343232f53343cd8ec5033b4bb60182 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Dec 2016 18:10:37 +0100 Subject: [PATCH] fixed two more places where a negative pitch was calculated: - A_CustomRailgun when missing the target. - A_FaceMovementDirection which ironically had some bad compensation inside. It is not restored to how the code looked in 2.8.1. --- src/p_actionfunctions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 202668c36b..e292447bf9 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -2302,7 +2302,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CustomRailgun) // We probably won't hit the target, but aim at it anyway so we don't look stupid. DVector2 xydiff = self->Vec2To(self->target); double zdiff = self->target->Center() - self->Center() - self->Floorclip; - self->Angles.Pitch = VecToAngle(xydiff.Length(), zdiff); + self->Angles.Pitch = -VecToAngle(xydiff.Length(), zdiff); } // Let the aim trail behind the player if (aim) @@ -6690,10 +6690,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FaceMovementDirection) { DAngle current = mobj->Angles.Pitch; const DVector2 velocity = mobj->Vel.XY(); - DAngle pitch = VecToAngle(velocity.Length(), mobj->Vel.Z); + DAngle pitch = -VecToAngle(velocity.Length(), mobj->Vel.Z); if (pitchlimit > 0) { - DAngle pdelta = deltaangle(-current, pitch); + DAngle pdelta = deltaangle(current, pitch); if (fabs(pdelta) > pitchlimit) {