Move RandomSpawner's recursion check into PostBeginPlay.

Previously, a RandomSpawner with infinite recursion would hang the game, because the recursion check was happening before the recursion counter (bouncecount) was set.
This commit is contained in:
argv-minus-one 2018-07-08 17:04:19 -07:00 committed by Christoph Oelckers
parent 55ae431c02
commit 6239796b92
1 changed files with 8 additions and 1 deletions

View File

@ -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();