- Exhumed: Move dead checks out of the input handler and into the ticker.

This commit is contained in:
Mitchell Richters 2023-03-18 19:29:15 +11:00
parent 1af60fb02b
commit 42a895d666
2 changed files with 12 additions and 14 deletions

View file

@ -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;

View file

@ -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)