- 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.
This commit is contained in:
Mitchell Richters 2023-05-08 21:34:56 +10:00
parent 04ac4561a8
commit ad87f9ba54

View file

@ -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;
}
//---------------------------------------------------------------------------