From 3271460c68ae0bb53d94266fbaa78954b1c3adcd Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 25 Aug 2020 18:05:16 +0200 Subject: [PATCH] No need to set locality rules in single player and no need to reverse a list that was just shuffled --- Fill.py | 8 +++----- Rules.py | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Fill.py b/Fill.py index 2aef1b84..9051f93a 100644 --- a/Fill.py +++ b/Fill.py @@ -125,7 +125,6 @@ def distribute_items_restrictive(world, gftower_trash=False, fill_locations=None trashcnt += 1 world.random.shuffle(fill_locations) - fill_locations.reverse() # Make sure the escape small key is placed first in standard with key shuffle to prevent running out of spots progitempool.sort( @@ -134,8 +133,8 @@ def distribute_items_restrictive(world, gftower_trash=False, fill_locations=None fill_restrictive(world, world.state, fill_locations, progitempool) - if any( - localprioitempool.values() or localrestitempool.values()): # we need to make sure some fills are limited to certain worlds + if any(localprioitempool.values() or + localrestitempool.values()): # we need to make sure some fills are limited to certain worlds for player, items in localprioitempool.items(): # items already shuffled local_locations = [location for location in fill_locations if location.player == player] world.random.shuffle(local_locations) @@ -152,11 +151,10 @@ def distribute_items_restrictive(world, gftower_trash=False, fill_locations=None fill_locations.remove(spot_to_fill) world.random.shuffle(fill_locations) - prioitempool, fill_locations = fast_fill(world, prioitempool, fill_locations) restitempool, fill_locations = fast_fill(world, restitempool, fill_locations) - unplaced = [item.name for item in progitempool + prioitempool + restitempool] + unplaced = [item for item in progitempool + prioitempool + restitempool] unfilled = [location.name for location in fill_locations] if unplaced or unfilled: diff --git a/Rules.py b/Rules.py index d1f3c4fe..05ad9a22 100644 --- a/Rules.py +++ b/Rules.py @@ -7,7 +7,8 @@ from OverworldGlitchRules import overworld_glitches_rules, no_logic_rules def set_rules(world, player): - locality_rules(world, player) + if world.players > 1: + locality_rules(world, player) if world.logic[player] == 'nologic': logging.getLogger('').info( 'WARNING! Seeds generated under this logic often require major glitches and may be impossible!')