mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-08 07:41:58 +00:00
- Blood: Clean up player vel code following InputPacket
changes.
This commit is contained in:
parent
7a5d89c851
commit
489e535992
1 changed files with 4 additions and 4 deletions
|
@ -1589,10 +1589,10 @@ void ProcessInput(DBloodPlayer* pPlayer)
|
||||||
if (!pInput->vel.XY().isZero() && (pPlayer->posture == 1 || actor->xspr.height < 256))
|
if (!pInput->vel.XY().isZero() && (pPlayer->posture == 1 || actor->xspr.height < 256))
|
||||||
{
|
{
|
||||||
const double speed = pPlayer->posture == 1? 1. : 1. - (actor->xspr.height * (1. / 256.) * (actor->xspr.height < 256));
|
const double speed = pPlayer->posture == 1? 1. : 1. - (actor->xspr.height * (1. / 256.) * (actor->xspr.height < 256));
|
||||||
const double fvAccel = pInput->vel.X > 0 ? pPosture->frontAccel : pPosture->backAccel;
|
pInput->vel.X *= pInput->vel.X > 0 ? pPosture->frontAccel : pPosture->backAccel;
|
||||||
const double svAccel = pPosture->sideAccel;
|
pInput->vel.Y *= pPosture->sideAccel;
|
||||||
actor->vel.XY() += DVector2(pInput->vel.X * fvAccel, pInput->vel.Y * svAccel).Rotated(actor->spr.Angles.Yaw) * speed;
|
actor->vel.XY() += pInput->vel.XY().Rotated(actor->spr.Angles.Yaw) * speed;
|
||||||
pPlayer->StrafeVel += pInput->vel.Y * svAccel * speed;
|
pPlayer->StrafeVel += pInput->vel.Y * speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPlayer->doViewYaw();
|
pPlayer->doViewYaw();
|
||||||
|
|
Loading…
Reference in a new issue