Fixes: TypeError: 'set' object is not subscriptable

random.choice does not work over set objects, cast to a list to allow 'trap_selection_override'
This commit is contained in:
ProverbialPennance
2025-02-13 01:25:02 +01:00
committed by GitHub
parent 59f7147fc4
commit cd1d7c844b

View File

@@ -832,7 +832,7 @@ class Items:
def get_filler_item_name(self, random: Random, options: SatisfactoryOptions) -> str:
trap_chance: int = options.trap_chance.value
enabled_traps: List[str] = options.trap_selection_override.value
enabled_traps: List[str] = list(options.trap_selection_override.value)
if enabled_traps and random.random() < (trap_chance / 100):
return random.choice(enabled_traps)