Syntax change for the failsafe

This commit is contained in:
Charles Peyrat 2020-12-11 01:24:20 +01:00
parent 45120d0c2b
commit 29798c135e
1 changed files with 1 additions and 2 deletions

View File

@ -66,7 +66,6 @@ class Generator:
# next iteration of the main loop
next_walker_pop = []
failsafe = choice(walkers)
for walker in walkers:
if grid[walker.y][walker.x] == Tile.EMPTY:
count += 1
@ -79,7 +78,7 @@ class Generator:
# we make sure to never kill all walkers
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
# like a walker not spliting because we hit the population cap even