- Avoid issues with misused Strife actions.

This commit is contained in:
Edoardo Prezioso 2016-06-17 23:09:34 +02:00
parent 24c73071f4
commit 56508a2d82

View file

@ -352,18 +352,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
if (self->player != nullptr && self->player->mo == self) if (self->player != nullptr && self->player->mo == self)
{ {
DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS); FState *firehands = self->FindState("FireHands");
if (psp != nullptr) if (firehands != NULL)
{ {
psp->SetState(self->FindState("FireHands")); DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS);
psp->Flags &= PSPF_ADDWEAPON | PSPF_ADDBOB; if (psp != nullptr)
psp->y = WEAPONTOP; {
} psp->SetState(firehands);
psp->Flags &= PSPF_ADDWEAPON | PSPF_ADDBOB;
psp->y = WEAPONTOP;
}
self->player->ReadyWeapon = nullptr; self->player->ReadyWeapon = nullptr;
self->player->PendingWeapon = WP_NOCHANGE; self->player->PendingWeapon = WP_NOCHANGE;
self->player->playerstate = PST_LIVE; self->player->playerstate = PST_LIVE;
self->player->extralight = 3; self->player->extralight = 3;
}
} }
return 0; return 0;
} }
@ -388,7 +392,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrispyPlayer)
DPSprite *psp; DPSprite *psp;
psp = self->player->GetPSprite(PSP_STRIFEHANDS); 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; return 0;
} }