mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Fixed infinite loop with None class in random spawner
actor NoneSpawner : RandomSpawner { DropItem "None" } https://forum.zdoom.org/viewtopic.php?t=60027
This commit is contained in:
parent
140ad241c4
commit
a6738fd139
1 changed files with 8 additions and 8 deletions
|
@ -44,16 +44,16 @@ class RandomSpawner : Actor
|
|||
{
|
||||
while (di != null)
|
||||
{
|
||||
if (di.Name != 'None')
|
||||
bool shouldSkip = (di.Name == 'None') || (nomonsters && IsMonster(di));
|
||||
|
||||
if (!shouldSkip)
|
||||
{
|
||||
if (!nomonsters || !IsMonster(di))
|
||||
{
|
||||
int amt = di.Amount;
|
||||
if (amt < 0) amt = 1; // default value is -1, we need a positive value.
|
||||
n += amt; // this is how we can weight the list.
|
||||
}
|
||||
di = di.Next;
|
||||
int amt = di.Amount;
|
||||
if (amt < 0) amt = 1; // default value is -1, we need a positive value.
|
||||
n += amt; // this is how we can weight the list.
|
||||
}
|
||||
|
||||
di = di.Next;
|
||||
}
|
||||
if (n == 0)
|
||||
{ // Nothing left to spawn. They must have all been monsters, and monsters are disabled.
|
||||
|
|
Loading…
Reference in a new issue