mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-30 20:51:02 +00:00
- Exhumed: Store a pos delta on the stack in `doPlayerMovement().
* We need this in a few places. * Z is inverted because pitch is negated. Previously I just swapped the operation around.
This commit is contained in:
parent
4fa12a9e30
commit
d858856e06
1 changed files with 3 additions and 2 deletions
|
@ -1749,11 +1749,12 @@ static bool doPlayerMovement(Player* const pPlayer)
|
|||
doPlayerMovingBlocks(pPlayer, nMove, spr_pos, spr_vel, spr_sect);
|
||||
}
|
||||
|
||||
const auto posdelta = spr_pos - pPlayerActor->spr.pos;
|
||||
pPlayer->ototalvel = pPlayer->totalvel;
|
||||
pPlayer->totalvel = int((spr_pos.XY() - pPlayerActor->spr.pos.XY()).Length() * worldtoint);
|
||||
pPlayer->totalvel = int(posdelta.XY().Length() * worldtoint);
|
||||
|
||||
// This should amplified 8x, not 2x, but it feels very heavy. Add a CVAR?
|
||||
doPlayerPitch(pPlayer, (pPlayerActor->spr.pos.Z - spr_pos.Z) * 2.);
|
||||
doPlayerPitch(pPlayer, -posdelta.Z * 2.);
|
||||
updatePlayerViewSector(pPlayer, nMove, spr_pos, spr_vel, bUnderwater);
|
||||
|
||||
pPlayer->nPlayerD = (pPlayerActor->spr.pos - spr_pos);
|
||||
|
|
Loading…
Reference in a new issue