speed up connecting single-doors

This commit is contained in:
Fabian Dill 2021-02-20 01:48:24 +01:00
parent 5e8b4ac3ce
commit a7cbb440d1
1 changed files with 4 additions and 3 deletions

View File

@ -2054,10 +2054,11 @@ def connect_doors(world, doors, targets, player):
"""This works inplace"""
world.random.shuffle(doors)
world.random.shuffle(targets)
while doors:
door = doors.pop()
target = targets.pop()
placing = min(len(doors), len(targets))
for door, target in zip(doors, targets):
connect_entrance(world, door, target, player)
doors[:] = doors[placing:]
targets[:] = targets[placing:]
def skull_woods_shuffle(world, player):