From 42a895d6662bb1eccbbedde6e9ee86d0a55a79b0 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 18 Mar 2023 19:29:15 +1100 Subject: [PATCH] - Exhumed: Move dead checks out of the input handler and into the ticker. --- source/games/exhumed/src/exhumed.cpp | 10 ++++++++++ source/games/exhumed/src/input.cpp | 16 ++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 35f5bb7c3..c2637f0df 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -390,6 +390,16 @@ void GameInterface::Ticker() } UpdateInterpolations(); + if (nFreeze) setForcedSyncInput(); + + if (PlayerList[nLocalPlayer].nHealth <= 0) + { + setForcedSyncInput(); + auto& packet = PlayerList[nLocalPlayer].input; + packet.fvel = packet.svel = packet.avel = packet.horz = 0; + lPlayerVel.Zero(); + } + if (PlayerList[nLocalPlayer].input.actions & SB_INVPREV) { int nItem = PlayerList[nLocalPlayer].nItem; diff --git a/source/games/exhumed/src/input.cpp b/source/games/exhumed/src/input.cpp index bca31c758..e0096aa2d 100644 --- a/source/games/exhumed/src/input.cpp +++ b/source/games/exhumed/src/input.cpp @@ -62,24 +62,12 @@ void GameInterface::GetInput(const double scaleAdjust, InputPacket* packet) Player* pPlayer = &PlayerList[nLocalPlayer]; InputPacket input {}; - if (PlayerList[nLocalPlayer].nHealth != 0) - { - processMovement(&input, &localInput, &hidInput, scaleAdjust); - } - else - { - pPlayer->vel.Zero(); - } + processMovement(&input, &localInput, &hidInput, scaleAdjust); - if (!SyncInput() && gamestate == GS_LEVEL && !nFreeze) + if (!SyncInput() && gamestate == GS_LEVEL) { pPlayer->Angles.CameraAngles.Yaw += DAngle::fromDeg(input.avel); pPlayer->Angles.CameraAngles.Pitch += DAngle::fromDeg(input.horz); - - if (input.horz) - { - pPlayer->bPlayerPan = pPlayer->bLockPan = true; - } } if (packet)