- Fixed: Lost Souls spawned by Pain Elementals were not killed by DF2_KILLBOSSMONST.

SVN r4047 (trunk)
This commit is contained in:
Randy Heit 2013-01-26 02:54:09 +00:00
parent 6a1f28e400
commit 9cca4ff71d
2 changed files with 15 additions and 7 deletions

View file

@ -78,17 +78,23 @@ DEFINE_ACTION_FUNCTION(AActor, A_BrainDie)
// New dmflag: Kill all boss spawned monsters before ending the level.
if (dmflags2 & DF2_KILLBOSSMONST)
{
int count; // Repeat until we have no more boss-spawned monsters.
do // (e.g. Pain Elementals can spawn more to kill upon death.)
{
TThinkerIterator<AActor> it;
AActor *mo;
count = 0;
while ((mo = it.Next()))
{
if (mo->flags4 & MF4_BOSSSPAWNED)
if (mo->health > 0 && mo->flags4 & MF4_BOSSSPAWNED)
{
P_DamageMobj(mo, self, self, mo->health, NAME_None,
DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR);
count++;
}
}
} while (count != 0);
}
G_ExitLevel (0, false);

View file

@ -111,6 +111,8 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype, int
other = Spawn (spawntype, x, y, z, ALLOW_REPLACE);
// Transfer boss-spawned flag
other->flags4 |= self->flags4 & MF4_BOSSSPAWNED;
// Check to see if the new Lost Soul's z value is above the
// ceiling of its new sector, or below the floor. If so, kill it.