Sanitize randomized_gear and starting_gear
@@ -9,7 +9,9 @@ from wwr_ui.inventory import INVENTORY_ITEMS, REGULAR_ITEMS, PROGRESSIVE_ITEMS
from wwr_ui.packedbits import PackedBitsReader, PackedBitsWriter
import random
+import collections
from collections import OrderedDict
+
import os
import traceback
import string
@@ -57,7 +59,6 @@ class WWRandomizerWindow(QMainWindow):
self.cached_item_locations = Logic.load_and_parse_item_locations()
-
self.load_settings()
self.ui.clean_iso_path.editingFinished.connect(self.update_settings)
@@ -728,6 +729,13 @@ class WWRandomizerWindow(QMainWindow):
self.ui.tabWidget.setTabEnabled(1, not self.get_option_value("race_mode"));
+ compare = lambda x, y: collections.Counter(x) == collections.Counter(y)
+ all_gear = self.get_option_value("starting_gear") + self.get_option_value("randomized_gear");
+
+ if not compare(all_gear, INVENTORY_ITEMS):
+ for opt in ["randomized_gear", "starting_gear"]:
+ self.set_option_value(opt, self.default_settings[opt])
+
for option_name in OPTIONS:
widget = getattr(self.ui, option_name)
if should_enable_options[option_name]:
