Removed unneeded checks

GetPSprite cannot return a null pointer and calling setstate with a null pointer destroys it
This commit is contained in:
Leonard2 2016-06-18 09:38:22 +02:00
parent da6e12d5bc
commit b8e1bead0a

View file

@ -351,24 +351,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
S_Sound (self, CHAN_VOICE, "human/imonfire", 1, ATTN_NORM);
if (self->player != nullptr && self->player->mo == self)
{
FState *firehands = self->FindState("FireHands");
if (firehands != NULL)
{
DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS);
if (psp != nullptr)
{
psp->SetState(firehands);
psp->Flags &= PSPF_ADDWEAPON | PSPF_ADDBOB;
psp->y = WEAPONTOP;
}
psp->SetState(self->FindState("FireHands"));
self->player->ReadyWeapon = nullptr;
self->player->PendingWeapon = WP_NOCHANGE;
self->player->playerstate = PST_LIVE;
self->player->extralight = 3;
}
}
return 0;
}