Added a weapon flag to ignore a player's input when dead

The reason this is not set by default is because before that anyone could call A_WeaponReady within their Deselect state which would have allowed players to fire even when dead
This commit is contained in:
Leonard2 2016-07-01 23:43:30 +02:00 committed by Christoph Oelckers
commit 797f3aec0a
3 changed files with 16 additions and 11 deletions

View file

@ -1396,20 +1396,23 @@ void player_t::TickPSprites()
pspr = pspr->Next;
}
if (ReadyWeapon == nullptr && (health > 0 || mo->DamageType != NAME_Fire))
if ((health > 0) || (ReadyWeapon != nullptr && !(ReadyWeapon->WeaponFlags & WIF_NODEATHINPUT)))
{
if (PendingWeapon != WP_NOCHANGE)
P_BringUpWeapon(this);
}
else
{
P_CheckWeaponSwitch(this);
if (WeaponState & (WF_WEAPONREADY | WF_WEAPONREADYALT))
if (ReadyWeapon == nullptr)
{
P_CheckWeaponFire(this);
if (PendingWeapon != WP_NOCHANGE)
P_BringUpWeapon(this);
}
else
{
P_CheckWeaponSwitch(this);
if (WeaponState & (WF_WEAPONREADY | WF_WEAPONREADYALT))
{
P_CheckWeaponFire(this);
}
// Check custom buttons
P_CheckWeaponButtons(this);
}
// Check custom buttons
P_CheckWeaponButtons(this);
}
}