From cb3fec39df6f3907f55c00b5b47ff0aa27c149b5 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 27 Mar 2023 08:36:04 +1100 Subject: [PATCH] - 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. --- source/games/exhumed/src/player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 00a38c893..d4dad4d59 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -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; }