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.

(cherry picked from commit 6239796b92)
This commit is contained in:
argv-minus-one 2018-07-08 17:04:19 -07:00 committed by drfrag666
parent 5a5d2593a5
commit ab64eb0473

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