No need to set locality rules in single player and no need to reverse a list that was just shuffled

This commit is contained in:
Fabian Dill 2020-08-25 18:05:16 +02:00
parent d86eb69b4c
commit 3271460c68
2 changed files with 5 additions and 6 deletions

View File

@ -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:

View File

@ -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!')