Factorio: Prevent invalid item counts in start items.

This commit is contained in:
Fabian Dill
2021-10-19 23:23:48 +02:00
parent ce95ff65bd
commit 7a9f6e2a8e
2 changed files with 10 additions and 3 deletions

View File

@@ -124,6 +124,12 @@ class FactorioStartItems(OptionDict):
displayname = "Starting Items"
default = {"burner-mining-drill": 19, "stone-furnace": 19}
def __init__(self, value: typing.Dict[str, typing.Any]):
print(value)
if any(item_count < 1 for item_count in value.values()):
raise Exception("Cannot have non-positive item counts.")
super().__init__(value)
class TrapCount(Range):
range_end = 4