- SW: Reduce some line lengths in DoPlayerVehicleInputScaling().

This commit is contained in:
Mitchell Richters 2023-10-29 22:47:48 +11:00
parent 7c93d5127b
commit 63ba784d55

View file

@ -935,13 +935,12 @@ void UpdatePlayerSpriteAngle(DSWPlayer* pp)
void DoPlayerVehicleInputScaling(DSWPlayer* const pp, DAngle DRotator::* angle, const float scale) void DoPlayerVehicleInputScaling(DSWPlayer* const pp, DAngle DRotator::* angle, const float scale)
{ {
SECTOR_OBJECT* sop = pp->sop;
DAngle& lastYaw = pp->lastcmd.ucmd.ang.*angle;
DAngle& currYaw = pp->cmd.ucmd.ang.*angle; DAngle& currYaw = pp->cmd.ucmd.ang.*angle;
if (sop->drive_angspeed) if (const auto angspeed = pp->sop->drive_angspeed)
{ {
currYaw = ((currYaw * sop->drive_angspeed) + (lastYaw * (sop->drive_angslide - 1))) / sop->drive_angslide; const auto angslide = pp->sop->drive_angslide;
currYaw = ((currYaw * angspeed) + (pp->lastcmd.ucmd.ang.*angle * (angslide - 1))) / angslide;
} }
else else
{ {