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

View file

@ -205,7 +205,11 @@ extend class Actor
if (mo.health > 0 && mo.bBossSpawned) if (mo.health > 0 && mo.bBossSpawned)
{ {
mo.DamageMobj(self, self, mo.health, "None", DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR); 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); } while (count != 0);