From 0b88bae458f4cf795028985c59bee6e75e442727 Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Fri, 3 Jun 2016 19:46:31 +0200 Subject: [PATCH] The strife firehands now make proper use of the psprite layers --- src/g_strife/a_strifestuff.cpp | 7 +++---- src/p_pspr.cpp | 4 ++++ src/p_pspr.h | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 3f444c39b..b92621ce0 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -352,8 +352,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns) if (self->player != nullptr && self->player->mo == self) { - self->player->GetPSprite(PSP_WEAPON)->SetState(self->FindState("FireHands")); - self->player->GetPSprite(PSP_FLASH)->SetState(nullptr); + self->player->GetPSprite(PSP_STRIFEHANDS)->SetState(self->FindState("FireHands")); self->player->ReadyWeapon = nullptr; self->player->PendingWeapon = WP_NOCHANGE; self->player->playerstate = PST_LIVE; @@ -381,7 +380,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrispyPlayer) self->player->playerstate = PST_DEAD; DPSprite *psp; - psp = self->player->GetPSprite(PSP_WEAPON); + psp = self->player->GetPSprite(PSP_STRIFEHANDS); psp->SetState(psp->GetState() + (self->FindState("FireHandsLower") - self->FindState("FireHands"))); } return 0; @@ -393,7 +392,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_HandLower) if (self->player != nullptr) { - DPSprite *psp = self->player->GetPSprite(PSP_WEAPON); + DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS); psp->y += 9; if (psp->y > WEAPONBOTTOM*2) { diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index d8f6ef58c..3defe5a41 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -187,6 +187,10 @@ DPSprite *player_t::GetPSprite(PSPLayers layer) newcaller = mo->FindInventory(RUNTIME_CLASS(APowerTargeter), true); } } + else if (layer == PSP_STRIFEHANDS) + { + newcaller = mo; + } else { newcaller = ReadyWeapon; diff --git a/src/p_pspr.h b/src/p_pspr.h index 5f2dda275..63c285075 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -44,6 +44,7 @@ class FArchive; // enum PSPLayers // These are all called by the owner's ReadyWeapon. { + PSP_STRIFEHANDS = -1, PSP_WEAPON = 1, PSP_FLASH = 1000, PSP_TARGETCENTER = INT_MAX - 2,