mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +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.
This commit is contained in:
parent
55ae431c02
commit
6239796b92
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