diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index c0e280762..4533016ec 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -378,14 +378,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrispyPlayer) if (self->player != nullptr && self->player->mo == self) { - self->player->playerstate = PST_DEAD; - DPSprite *psp; psp = self->player->GetPSprite(PSP_STRIFEHANDS); + FState *firehandslower = self->FindState("FireHandsLower"); FState *firehands = self->FindState("FireHands"); - if (firehandslower != NULL && firehands != NULL && firehands < firehandslower) - psp->SetState(psp->GetState() + (firehandslower - firehands)); + FState *state = psp->GetState(); + + if (state != nullptr && firehandslower != nullptr && firehands != nullptr && firehands < firehandslower) + { + self->player->playerstate = PST_DEAD; + psp->SetState(state + (firehandslower - firehands)); + } + else if (state == nullptr) + { + psp->SetState(nullptr); + } } return 0; } @@ -397,13 +405,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_HandLower) if (self->player != nullptr) { DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS); + + if (psp->GetState() == nullptr) + { + psp->SetState(nullptr); + return 0; + } + psp->y += 9; if (psp->y > WEAPONBOTTOM*2) { psp->SetState(nullptr); } + if (self->player->extralight > 0) self->player->extralight--; } return 0; } - diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 94a0084dd..2e285b34a 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -231,6 +231,9 @@ DPSprite *player_t::GetPSprite(PSPLayers layer) } if (layer == PSP_STRIFEHANDS) { + // Some of the old hacks rely on this layer coming from the FireHands state. + // This is the ONLY time a psprite's state is actually null. + pspr->State = nullptr; pspr->y = WEAPONTOP; }