mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +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
|
@ -352,22 +352,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
|
|||
|
||||
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;
|
||||
}
|
||||
DPSprite *psp = self->player->GetPSprite(PSP_STRIFEHANDS);
|
||||
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;
|
||||
}
|
||||
self->player->ReadyWeapon = nullptr;
|
||||
self->player->PendingWeapon = WP_NOCHANGE;
|
||||
self->player->playerstate = PST_LIVE;
|
||||
self->player->extralight = 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue