From ad87f9ba54e3170ff08f0561f6fce4f7deea6344 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 8 May 2023 21:34:56 +1000 Subject: [PATCH] - Duke: Adjust `doVehicleTilting()` somewhat. * Don't adjust and scale the player's roll, we can rely on `player_struct::TiltStatus` alone for this. * Ensure maximum tilt via full keyboard turn == (20. * 360. / 2048. * 0.5), same as original code. --- source/games/duke/src/player_r.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index ef877402c..d04d597a6 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -729,16 +729,13 @@ static unsigned outVehicleFlags(player_struct* p, ESyncBits& actions) static void doVehicleTilting(player_struct* const p, const bool canTilt) { - const auto pact = p->GetActor(); - auto adj = DAngle::fromDeg(p->sync.avel * 0.279625 * canTilt); + auto adj = DAngle::fromDeg(p->sync.avel * (545943. / 3200000.) * canTilt); if (p->OnMotorcycle) adj *= 5 * Sgn(p->MotoSpeed); if (cl_rrvehicletilting) adj *= cl_viewtiltscale; p->oTiltStatus = p->TiltStatus; - p->TiltStatus += adj; - pact->spr.Angles.Roll += adj * cl_rrvehicletilting; scaletozero(p->TiltStatus, 10.); - scaletozero(pact->spr.Angles.Roll, 10.); + p->GetActor()->spr.Angles.Roll = (p->TiltStatus += adj) * cl_rrvehicletilting; } //---------------------------------------------------------------------------