Syntax change for the failsafe
This commit is contained in:
parent
45120d0c2b
commit
29798c135e
|
@ -66,7 +66,6 @@ class Generator:
|
||||||
# next iteration of the main loop
|
# next iteration of the main loop
|
||||||
next_walker_pop = []
|
next_walker_pop = []
|
||||||
|
|
||||||
failsafe = choice(walkers)
|
|
||||||
for walker in walkers:
|
for walker in walkers:
|
||||||
if grid[walker.y][walker.x] == Tile.EMPTY:
|
if grid[walker.y][walker.x] == Tile.EMPTY:
|
||||||
count += 1
|
count += 1
|
||||||
|
@ -79,7 +78,7 @@ class Generator:
|
||||||
|
|
||||||
# we make sure to never kill all walkers
|
# we make sure to never kill all walkers
|
||||||
if next_walker_pop == []:
|
if next_walker_pop == []:
|
||||||
next_walker_pop.append(failsafe)
|
next_walker_pop.append(choice(walkers))
|
||||||
|
|
||||||
# we use a second loop for spliting so we're not bothered by cases
|
# we use a second loop for spliting so we're not bothered by cases
|
||||||
# like a walker not spliting because we hit the population cap even
|
# like a walker not spliting because we hit the population cap even
|
||||||
|
|
Loading…
Reference in New Issue