mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-26 22:11:54 +00:00
- SW: Shorten the setup in DoPlayerVehicleInputScaling()
.
This commit is contained in:
parent
d6de57095d
commit
984ae6b098
1 changed files with 4 additions and 2 deletions
|
@ -1447,14 +1447,16 @@ void UpdatePlayerSpriteAngle(DSWPlayer* pp)
|
|||
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;
|
||||
|
||||
if (sop->drive_angspeed)
|
||||
{
|
||||
pp->cmd.ucmd.ang.*angle = ((pp->cmd.ucmd.ang.*angle * sop->drive_angspeed) + (pp->lastcmd.ucmd.ang.*angle * (sop->drive_angslide - 1))) / sop->drive_angslide;
|
||||
currYaw = ((currYaw * sop->drive_angspeed) + (lastYaw * (sop->drive_angslide - 1))) / sop->drive_angslide;
|
||||
}
|
||||
else
|
||||
{
|
||||
pp->cmd.ucmd.ang.*angle *= synctics * scale;
|
||||
currYaw *= synctics * scale;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue