From 3a99aedf8993ffec3041779956d5785acf5cbadb Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 11 Jan 2021 02:55:32 +0100 Subject: [PATCH] safer failure in case of no more candidate swaps --- Main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Main.py b/Main.py index eb094246..56c24878 100644 --- a/Main.py +++ b/Main.py @@ -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