Add safeguard to prevent errors when not enough consumables
@@ -38,6 +38,9 @@ def randomize_items(self):
locations_to_place_consumables_at = self.logic.remaining_item_locations.copy()
for location_name in locations_to_place_consumables_at:
possible_items = self.logic.filter_items_valid_for_location(self.logic.unplaced_consumable_items, location_name)
+ if len(possible_items) == 0:
+ item_name = "Red Rupee"
+ else:
item_name = self.rng.choice(possible_items)
self.logic.set_location_to_item(location_name, item_name)
