Fixed a case of infinite loop in A_BrainDie

This commit is contained in:
Blue Shadow 2018-01-08 19:04:18 +03:00 committed by Rachael Alexanderson
parent 6370594e17
commit f68d90accb
1 changed files with 5 additions and 1 deletions

View File

@ -205,7 +205,11 @@ extend class Actor
if (mo.health > 0 && mo.bBossSpawned)
{
mo.DamageMobj(self, self, mo.health, "None", DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR);
count++;
// [Blue Shadow] If 'mo' is a RandomSpawner or another actor which can't be killed,
// it could cause this code to loop indefinitely. So only let it trigger a loop if it
// has been actually killed.
if (mo.bKilled) count++;
}
}
} while (count != 0);