From 6602c580f4ba7b26f61748552cb593694cdd3d0f Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Wed, 17 Aug 2022 07:16:14 -0700 Subject: [PATCH] Fix another item.type crash bug. (#927) * Fix another item.type crash bug. * Another location that can crash, in the instance of plando fixed. --- worlds/oot/HintList.py | 3 ++- worlds/oot/Patches.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/worlds/oot/HintList.py b/worlds/oot/HintList.py index 06af1a9b..7fc298b0 100644 --- a/worlds/oot/HintList.py +++ b/worlds/oot/HintList.py @@ -1,6 +1,7 @@ import random from BaseClasses import LocationProgressType +from .Items import OOTItem # Abbreviations # DMC Death Mountain Crater @@ -1260,7 +1261,7 @@ def hintExclusions(world, clear_cache=False): world.hint_exclusions = [] for location in world.get_locations(): - if (location.locked and (location.item.type != 'Song' or world.shuffle_song_items != 'song')) or location.progress_type == LocationProgressType.EXCLUDED: + if (location.locked and ((isinstance(location.item, OOTItem) and location.item.type != 'Song') or world.shuffle_song_items != 'song')) or location.progress_type == LocationProgressType.EXCLUDED: world.hint_exclusions.append(location.name) world_location_names = [ diff --git a/worlds/oot/Patches.py b/worlds/oot/Patches.py index 91f656b4..7bf31c4f 100644 --- a/worlds/oot/Patches.py +++ b/worlds/oot/Patches.py @@ -2104,7 +2104,7 @@ def place_shop_items(rom, world, shop_items, messages, locations, init_shop_id=F shop_objs = { 0x0148 } # "Sold Out" object for location in locations: - if location.item.type == 'Shop': + if isinstance(location.item, OOTItem) and location.item.type == 'Shop': shop_objs.add(location.item.special['object']) rom.write_int16(location.address1, location.item.index) else: