- Exhumed: Move a line out of doPlayerMovement() and into updatePlayerViewSector().

* It needs to come after the function it's been moved into, but its confusing why its calculating a new pos delta when there's one on the stack.
* By directly nesting it in, it's a lot clearer.
This commit is contained in:
Mitchell Richters 2023-03-27 08:36:04 +11:00
parent d858856e06
commit cb3fec39df

View file

@ -1587,6 +1587,8 @@ static void updatePlayerViewSector(Player* const pPlayer, const Collision& nMove
pLocalEyeSect = pPlayer->pPlayerViewSect;
CheckAmbience(pLocalEyeSect);
}
pPlayer->nPlayerD = pPlayerActor->spr.pos - spr_pos;
}
//---------------------------------------------------------------------------
@ -1757,8 +1759,6 @@ static bool doPlayerMovement(Player* const pPlayer)
doPlayerPitch(pPlayer, -posdelta.Z * 2.);
updatePlayerViewSector(pPlayer, nMove, spr_pos, spr_vel, bUnderwater);
pPlayer->nPlayerD = (pPlayerActor->spr.pos - spr_pos);
return true;
}