diff --git a/source/exhumed/src/input.cpp b/source/exhumed/src/input.cpp index bef919f6f..2c23998fa 100644 --- a/source/exhumed/src/input.cpp +++ b/source/exhumed/src/input.cpp @@ -94,14 +94,13 @@ void CheckKeys2() } -static void processMovement(ControlInfo* const hidInput) +static void processMovement(ControlInfo* const hidInput, double const scaleAdjust) { // JBF: Run key behaviour is selectable int const playerRunning = !!(localInput.actions & SB_RUN); int const turnAmount = playerRunning ? 12 : 8; int const keyMove = playerRunning ? 12 : 6; bool const mouseaim = !(localInput.actions & SB_AIMMODE); - double const scaleAdjust = InputScale(); InputPacket tempinput {}; if (buttonMap.ButtonDown(gamefunc_Strafe)) @@ -200,8 +199,6 @@ static void processMovement(ControlInfo* const hidInput) sethorizon(&pPlayer->q16horiz, tempinput.q16horz, &sPlayerInput[nLocalPlayer].actions, scaleAdjust); UpdatePlayerSpriteAngle(pPlayer); } - - playerProcessHelpers(&pPlayer->q16angle, &pPlayer->angAdjust, &pPlayer->angTarget, &pPlayer->q16horiz, &pPlayer->horizAdjust, &pPlayer->horizTarget, scaleAdjust); } } @@ -221,6 +218,10 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput) if (PlayerList[nLocalPlayer].nHealth == 0) localInput.actions &= SB_OPEN; } + double const scaleAdjust = InputScale(); + Player* pPlayer = &PlayerList[nLocalPlayer]; + playerProcessHelpers(&pPlayer->q16angle, &pPlayer->angAdjust, &pPlayer->angTarget, &pPlayer->q16horiz, &pPlayer->horizAdjust, &pPlayer->horizTarget, scaleAdjust); + if (PlayerList[nLocalPlayer].nHealth == 0) { lPlayerYVel = 0; @@ -228,7 +229,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput) return; } - processMovement(hidInput); + processMovement(hidInput, scaleAdjust); if (packet) *packet = localInput; } diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index 6cfcd9b0e..6672b12d1 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -725,6 +725,8 @@ void FuncPlayer(int a, int nDamage, int nRun) short nSprite2; + PlayerList[nPlayer].angAdjust = 0; + PlayerList[nPlayer].horizAdjust = 0; PlayerList[nPlayer].opos = sprite[nPlayerSprite].pos; PlayerList[nPlayer].oq16angle = PlayerList[nPlayer].q16angle; PlayerList[nPlayer].oq16horiz = PlayerList[nPlayer].q16horiz;