From 56508a2d820811aaf46ef9dc2c9d4dfdef1ce897 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Fri, 17 Jun 2016 23:09:34 +0200 Subject: [PATCH] - Avoid issues with misused Strife actions. --- src/g_strife/a_strifestuff.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 983acb1d3..8b5788d44 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -352,18 +352,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns) if (self->player != nullptr && self->player->mo == self) { - DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS); - if (psp != nullptr) + FState *firehands = self->FindState("FireHands"); + if (firehands != NULL) { - psp->SetState(self->FindState("FireHands")); - psp->Flags &= PSPF_ADDWEAPON | PSPF_ADDBOB; - psp->y = WEAPONTOP; - } + DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS); + if (psp != nullptr) + { + psp->SetState(firehands); + psp->Flags &= PSPF_ADDWEAPON | PSPF_ADDBOB; + psp->y = WEAPONTOP; + } - self->player->ReadyWeapon = nullptr; - self->player->PendingWeapon = WP_NOCHANGE; - self->player->playerstate = PST_LIVE; - self->player->extralight = 3; + self->player->ReadyWeapon = nullptr; + self->player->PendingWeapon = WP_NOCHANGE; + self->player->playerstate = PST_LIVE; + self->player->extralight = 3; + } } return 0; } @@ -388,7 +392,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrispyPlayer) DPSprite *psp; psp = self->player->GetPSprite(PSP_STRIFEHANDS); - psp->SetState(psp->GetState() + (self->FindState("FireHandsLower") - self->FindState("FireHands"))); + FState *firehandslower = self->FindState("FireHandsLower"); + FState *firehands = self->FindState("FireHands"); + if (firehandslower != NULL && firehands != NULL && firehands < firehandslower) + psp->SetState(psp->GetState() + (firehandslower - firehands)); } return 0; }