mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 15:11:04 +00:00
- Exhumed: Move dead checks out of the input handler and into the ticker.
This commit is contained in:
parent
1af60fb02b
commit
42a895d666
2 changed files with 12 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue