From eea4cb581524435f24a7eaa7742050b6d479c80e Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Fri, 8 Jan 2021 06:37:23 -0800 Subject: [PATCH] Make sure yamls that specify key drop plando locations don't fail. --- Fill.py | 4 ++++ Mystery.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Fill.py b/Fill.py index b0cd58bd..218c81c2 100644 --- a/Fill.py +++ b/Fill.py @@ -3,6 +3,7 @@ import typing from BaseClasses import CollectionState, PlandoItem from Items import ItemFactory +from Regions import key_drop_data class FillError(RuntimeError): @@ -361,6 +362,9 @@ def distribute_planned(world): for player in world.player_ids: placement: PlandoItem for placement in world.plando_items[player]: + if placement.location in key_drop_data: + placement.warn(f"Can't place '{placement.item}' at '{placement.location}', as key drop shuffle locations are not supported yet.") + continue item = ItemFactory(placement.item, player) target_world: int = placement.world if target_world is False or world.players == 1: diff --git a/Mystery.py b/Mystery.py index ef95b905..a954c326 100644 --- a/Mystery.py +++ b/Mystery.py @@ -18,7 +18,7 @@ from EntranceRandomizer import parse_arguments from Main import main as ERmain from Main import get_seed, seeddigits from Items import item_name_groups, item_table -from Regions import location_table +from Regions import location_table, key_drop_data from Text import TextTable @@ -565,7 +565,7 @@ def roll_settings(weights, plando_options: typing.Set[str] = frozenset(("bosses" 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") - if location not in location_table: + if location not in location_table and location not in key_drop_data: raise Exception(f"Could not plando item {item} at location {location} as the location was not recognized") ret.plando_items.append(PlandoItem(item, location, location_world, from_pool, force))