From 48812ad2966a2b87ad5644580d21e6c69e0edd5d Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Fri, 8 Jan 2021 06:35:12 -0800 Subject: [PATCH] Fix bug regarding silent failed plando. --- Mystery.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Mystery.py b/Mystery.py index 9054c2a4..ef95b905 100644 --- a/Mystery.py +++ b/Mystery.py @@ -561,6 +561,7 @@ def roll_settings(weights, plando_options: typing.Set[str] = frozenset(("bosses" ret.plando_items = [] if "items" in plando_options: + default_placement = PlandoItem(item="", location="") def add_plando_item(item: str, location: str): if item not in item_table: raise Exception(f"Could not plando item {item} as the item was not recognized") @@ -571,9 +572,9 @@ def roll_settings(weights, plando_options: typing.Set[str] = frozenset(("bosses" options = weights.get("plando_items", []) for placement in options: if roll_percentage(get_choice("percentage", placement, 100)): - from_pool = get_choice("from_pool", placement, True) - location_world = get_choice("world", placement, False) - force = get_choice("force", placement, False) + from_pool = get_choice("from_pool", placement, default_placement.from_pool) + location_world = get_choice("world", placement, default_placement.world) + force = get_choice("force", placement, default_placement.force) if "items" in placement and "locations" in placement: items = placement["items"] locations = placement["locations"]