From f68d90accbb252306bcef62645f78afa0dfc4798 Mon Sep 17 00:00:00 2001 From: Blue Shadow Date: Mon, 8 Jan 2018 19:04:18 +0300 Subject: [PATCH] Fixed a case of infinite loop in A_BrainDie --- wadsrc/static/zscript/doom/bossbrain.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/doom/bossbrain.txt b/wadsrc/static/zscript/doom/bossbrain.txt index fadc280e3d..163683f277 100644 --- a/wadsrc/static/zscript/doom/bossbrain.txt +++ b/wadsrc/static/zscript/doom/bossbrain.txt @@ -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);