diff --git a/wadsrc/static/zscript/shared/randomspawner.txt b/wadsrc/static/zscript/shared/randomspawner.txt index 24892aeec..28313bbb7 100644 --- a/wadsrc/static/zscript/shared/randomspawner.txt +++ b/wadsrc/static/zscript/shared/randomspawner.txt @@ -84,7 +84,7 @@ class RandomSpawner : Actor } } // So now we can spawn the dropped item. - if (di == null || bouncecount >= MAX_RANDOMSPAWNERS_RECURSION) // Prevents infinite recursions + if (di == null) { Spawn("Unknown", Pos, NO_REPLACE); // Show that there's a problem. Destroy(); @@ -131,6 +131,13 @@ class RandomSpawner : Actor Actor newmobj = null; bool boss = false; + if (bouncecount >= MAX_RANDOMSPAWNERS_RECURSION) // Prevents infinite recursions + { + Spawn("Unknown", Pos, NO_REPLACE); // Show that there's a problem. + Destroy(); + return; + } + if (Species == 'None') { Destroy();