safer failure in case of no more candidate swaps

This commit is contained in:
Fabian Dill 2021-01-11 02:55:32 +01:00
parent f47fafe7e3
commit 3a99aedf89
1 changed files with 3 additions and 1 deletions

View File

@ -238,8 +238,10 @@ def main(args, seed=None):
candidates.remove(c)
break
else:
# This *should* never happen. But let's fail safely just in case.
logging.warning("Ran out of ShopShuffle Item candidate locations.")
break # we ran out of candidates
shop.region.locations.remove(location)
continue
# update table to location data
item_name = location.item.name