From 0d5d1c7a09d867091a8254d3c41dbd9b61da51a9 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 17 Nov 2022 18:50:25 -0800 Subject: [PATCH] Invert yaw diff in reverse HUD tracking This fixes the player CHECK moving in the opposite direction of what it should across the screen. --- src/k_hud.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/k_hud.c b/src/k_hud.c index d4127e131..a08be833f 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -950,6 +950,11 @@ void K_ObjectTracking(trackingResult_t *result, vector3_t *point, boolean revers h = R_PointToDist2(point->x, point->y, viewx, viewy); da = AngleDeltaSigned(viewpointAngle, R_PointToAngle2(point->x, point->y, viewx, viewy)); + if (reverse) + { + da = -(da); + } + // Set results relative to top left! result->x = FixedMul(NEWTAN(da), fg); result->y = FixedMul((NEWTAN(viewpointAiming) - FixedDiv((viewz - point->z), 1 + FixedMul(NEWCOS(da), h))), fg);