mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 01:21:17 +00:00
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:
parent
5a5d2593a5
commit
ab64eb0473
1 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue