From 19ddc1ee51dd1d954583af15db6c82c6064645fe Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 21 Mar 2023 09:33:27 +1100 Subject: [PATCH] - Duke/RR: Repair angle test when adjusting velocity. * Initially figured I could just use the sign of the angle adjustment, but the vehicle code makes left/right reversals that necessitate using the flags for this. --- source/games/duke/src/player_r.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index f7b5f46ce..5a6ee600b 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1735,7 +1735,7 @@ static void onMotorcycle(int snum, ESyncBits &actions) int currSpeed = int(p->MotoSpeed); if (p->MotoSpeed >= 20 && p->on_ground == 1 && (flags & (VEH_TURNLEFT|VEH_TURNRIGHT))) { - velAdjustment = adjust * Sgn(p->sync.avel); + velAdjustment = (flags & VEH_TURNLEFT) ? -adjust : adjust; auto angAdjustment = (350 << 21) * velAdjustment.Sgn(); if (p->moto_on_mud || p->moto_on_oil || !p->NotOnWater) @@ -1831,7 +1831,8 @@ static void onBoat(int snum, ESyncBits &actions) if (p->MotoSpeed > 0 && p->on_ground == 1 && (flags & (VEH_TURNLEFT|VEH_TURNRIGHT))) { int currSpeed = int(p->MotoSpeed * 4.); - DAngle velAdjustment = mapangle(-510) * Sgn(p->sync.avel); + constexpr DAngle adjust = mapangle(-510); + DAngle velAdjustment = (flags & VEH_TURNLEFT) ? -adjust : adjust; auto angAdjustment = (350 << 21) * velAdjustment.Sgn(); if (p->moto_do_bump)