mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
Removed unneeded checks
GetPSprite cannot return a null pointer and calling setstate with a null pointer destroys it
This commit is contained in:
parent
da6e12d5bc
commit
b8e1bead0a
1 changed files with 8 additions and 15 deletions
|
@ -351,24 +351,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
|
||||||
S_Sound (self, CHAN_VOICE, "human/imonfire", 1, ATTN_NORM);
|
S_Sound (self, CHAN_VOICE, "human/imonfire", 1, ATTN_NORM);
|
||||||
|
|
||||||
if (self->player != nullptr && self->player->mo == self)
|
if (self->player != nullptr && self->player->mo == self)
|
||||||
{
|
|
||||||
FState *firehands = self->FindState("FireHands");
|
|
||||||
if (firehands != NULL)
|
|
||||||
{
|
{
|
||||||
DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS);
|
DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS);
|
||||||
if (psp != nullptr)
|
|
||||||
{
|
|
||||||
psp->SetState(firehands);
|
|
||||||
psp->Flags &= PSPF_ADDWEAPON | PSPF_ADDBOB;
|
psp->Flags &= PSPF_ADDWEAPON | PSPF_ADDBOB;
|
||||||
psp->y = WEAPONTOP;
|
psp->y = WEAPONTOP;
|
||||||
}
|
psp->SetState(self->FindState("FireHands"));
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue