mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-08-25 14:16:41 -07:00
Core: Add new error message for item count when defined as a set instead of a dict (#4100)
* Core: New error message if item count is a set * Apply suggestion for error message Co-authored-by: Exempt-Medic <[email protected]> * Apply item count error suggestion Co-authored-by: Nicholas Saylor <[email protected]> --------- Co-authored-by: Exempt-Medic <[email protected]> Co-authored-by: Nicholas Saylor <[email protected]>
This commit is contained in:
co-authored by
Exempt-Medic
Nicholas Saylor
parent
21dbfd2472
commit
1a5d22ca78
@@ -863,6 +863,8 @@ class ItemDict(OptionDict):
|
||||
verify_item_name = True
|
||||
|
||||
def __init__(self, value: typing.Dict[str, int]):
|
||||
if any(item_count is None for item_count in value.values()):
|
||||
raise Exception("Items must have counts associated with them. Please provide positive integer values in the format \"item\": count .")
|
||||
if any(item_count < 1 for item_count in value.values()):
|
||||
raise Exception("Cannot have non-positive item counts.")
|
||||
super(ItemDict, self).__init__(value)
|
||||
|
||||
Reference in New Issue
Block a user