- 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,24 +529,26 @@ 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 ((fakeme->UnmorphTime) && if (realme != NULL)
(fakeme->MorphStyle & MORPH_UNDOBYDEATH) &&
(realme))
{ {
int realstyle = fakeme->MorphStyle; if ((fakeme->UnmorphTime) &&
int realhealth = fakeme->health; (fakeme->MorphStyle & MORPH_UNDOBYDEATH))
if (P_UndoMonsterMorph(fakeme, !!(fakeme->MorphStyle & MORPH_UNDOBYDEATHFORCED)))
{ {
*morphed = realme; int realstyle = fakeme->MorphStyle;
*morphedstyle = realstyle; int realhealth = fakeme->health;
*morphedhealth = realhealth; if (P_UndoMonsterMorph(fakeme, !!(fakeme->MorphStyle & MORPH_UNDOBYDEATHFORCED)))
return true; {
*morphed = realme;
*morphedstyle = realstyle;
*morphedhealth = realhealth;
return true;
}
}
if (realme->flags4 & MF4_BOSSDEATH)
{
realme->health = 0; // make sure that A_BossDeath considers it dead.
CALL_ACTION(A_BossDeath, realme);
} }
}
if (realme->flags4 & MF4_BOSSDEATH)
{
realme->health = 0; // make sure that A_BossDeath considers it dead.
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;