From 5907ff662d6cd3a5f574150cfb93fb5794a30456 Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Fri, 1 Jul 2016 05:41:14 +0200 Subject: [PATCH] Added a new state that the weapon jumps to when it is lowered all the way and the player is currently dead The state is undefined by default to preserve the original behavior of having the weapon layer deleted which modders can now avoid by defining it properly --- src/namedef.h | 1 + src/p_pspr.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/namedef.h b/src/namedef.h index 17fa9e291..cd0d5615b 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -214,6 +214,7 @@ xx(Brainexplode) // Weapon animator names. xx(Select) xx(Deselect) +xx(DeadLowered) xx(Ready) xx(Fire) xx(Hold) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 350acc3fd..48ead3699 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -1087,7 +1087,7 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower) { // Player is dead, so don't bring up a pending weapon // Player is dead, so keep the weapon off screen P_SetPsprite(player, PSP_FLASH, nullptr); - psp->SetState(nullptr); + psp->SetState(player->ReadyWeapon->FindState(NAME_DeadLowered)); return 0; } // [RH] Clear the flash state. Only needed for Strife.