From bcb18cf7d8e30651127f8dabf5a844858eb2f3b8 Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Fri, 1 Jul 2016 22:47:30 +0200 Subject: [PATCH] Added a flag to prevent the weapon from jumping to its Deselect state when the player dies --- src/g_shared/a_pickups.h | 1 + src/p_pspr.cpp | 2 +- src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index 26b27e202..d432fdda0 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -378,6 +378,7 @@ enum WIF_MELEEWEAPON = 0x00008000, // melee weapon. Used by bots and monster AI. WIF_DEHAMMO = 0x00010000, // Uses Doom's original amount of ammo for the respective attack functions so that old DEHACKED patches work as intended. // AmmoUse1 will be set to the first attack's ammo use so that checking for empty weapons still works + WIF_NODEATHJUMP = 0x00020000, // Don't jump to the Deselect state when the player dies WIF_CHEATNOTWEAPON = 0x08000000, // Give cheat considers this not a weapon (used by Sigil) // Flags used only by bot AI: diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index bad9c2d73..73a8054f0 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -510,7 +510,7 @@ void P_DropWeapon (player_t *player) } // Since the weapon is dropping, stop blocking switching. player->WeaponState &= ~WF_DISABLESWITCH; - if (player->ReadyWeapon != nullptr) + if ((player->ReadyWeapon != nullptr) && (player->health > 0 || !(player->ReadyWeapon->WeaponFlags & WIF_NODEATHJUMP))) { P_SetPsprite(player, PSP_WEAPON, player->ReadyWeapon->GetDownState()); } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index a86e98566..fca7f2ddb 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -362,6 +362,7 @@ static FFlagDef WeaponFlagDefs[] = DEFINE_FLAG(WIF, NO_AUTO_SWITCH, AWeapon, WeaponFlags), DEFINE_FLAG(WIF, AMMO_CHECKBOTH, AWeapon, WeaponFlags), DEFINE_FLAG(WIF, NOAUTOAIM, AWeapon, WeaponFlags), + DEFINE_FLAG(WIF, NODEATHJUMP, AWeapon, WeaponFlags), DEFINE_DUMMY_FLAG(NOLMS), DEFINE_FLAG(WIF, ALT_USES_BOTH, AWeapon, WeaponFlags),