- fixed: The A_BossDeath code in P_MorphedDeath was missing a NULL pointer check.

This commit is contained in:
Christoph Oelckers 2014-12-27 19:19:15 +01:00
parent f054f626d2
commit cef8ae5632

View file

@ -529,9 +529,10 @@ bool P_MorphedDeath(AActor *actor, AActor **morphed, int *morphedstyle, int *mor
{ {
AMorphedMonster *fakeme = static_cast<AMorphedMonster *>(actor); AMorphedMonster *fakeme = static_cast<AMorphedMonster *>(actor);
AActor *realme = fakeme->UnmorphedMe; AActor *realme = fakeme->UnmorphedMe;
if (realme != NULL)
{
if ((fakeme->UnmorphTime) && if ((fakeme->UnmorphTime) &&
(fakeme->MorphStyle & MORPH_UNDOBYDEATH) && (fakeme->MorphStyle & MORPH_UNDOBYDEATH))
(realme))
{ {
int realstyle = fakeme->MorphStyle; int realstyle = fakeme->MorphStyle;
int realhealth = fakeme->health; int realhealth = fakeme->health;
@ -548,6 +549,7 @@ bool P_MorphedDeath(AActor *actor, AActor **morphed, int *morphedstyle, int *mor
realme->health = 0; // make sure that A_BossDeath considers it dead. realme->health = 0; // make sure that A_BossDeath considers it dead.
CALL_ACTION(A_BossDeath, realme); CALL_ACTION(A_BossDeath, realme);
} }
}
fakeme->flags3 |= MF3_STAYMORPHED; // moved here from AMorphedMonster::Die() fakeme->flags3 |= MF3_STAYMORPHED; // moved here from AMorphedMonster::Die()
return false; return false;
} }