Skip to content

Commit 7bf6958

Browse files
ScipioWrightqwint
authored andcommitted
Core: Silently fix invalid yaml option for Toggles (ArchipelagoMW#3179)
1 parent ff9b1a9 commit 7bf6958

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Options.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ class Toggle(NumericOption):
384384
default = 0
385385

386386
def __init__(self, value: int):
387-
assert value == 0 or value == 1, "value of Toggle can only be 0 or 1"
387+
# if user puts in an invalid value, make it valid
388+
value = int(bool(value))
388389
self.value = value
389390

390391
@classmethod

0 commit comments

Comments
 (0)