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:
parent
bcb18cf7d8
commit
797f3aec0a
3 changed files with 16 additions and 11 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue