Make sure yamls that specify key drop plando locations don't fail.

This commit is contained in:
CaitSith2 2021-01-08 06:37:23 -08:00
parent 48812ad296
commit eea4cb5815
2 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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))