If due to DR or Plando the world is not fulfilling access rules, default to can_beat_game for Shop Logic

This commit is contained in:
Fabian Dill 2021-01-14 00:26:49 +01:00
parent 082a7b7e41
commit d214783932
1 changed files with 8 additions and 1 deletions

View File

@ -229,6 +229,13 @@ def main(args, seed=None):
world.random.shuffle(candidates)
if not world.fulfills_accessibility():
logger.warning("World does not fulfill accessibility rules as is, "
"only using \"beatable only\" for shop logic.")
shuffle_condition = world.can_beat_game
else:
shuffle_condition = world.fulfills_accessibility
# currently special care needs to be taken so that Shop.region.locations.item is identical to Shop.inventory
# Potentially create Locations as needed and make inventory the only source, to prevent divergence
@ -241,7 +248,7 @@ def main(args, seed=None):
swap_location_item(c, location, check_locked=False)
candidates.remove(c)
if not world.fulfills_accessibility():
if not shuffle_condition():
swap_location_item(c, location, check_locked=False)
continue