From 645ede869f18ff3b8bbb3cf0f265ba8d0ab1bc26 Mon Sep 17 00:00:00 2001 From: espeon65536 <81029175+espeon65536@users.noreply.github.com> Date: Fri, 12 Aug 2022 19:36:06 -0700 Subject: [PATCH] OoT: Fix blind item.type reference (#905) * oot: remove blind reference to item.type * oot: logical reasoning is hard * oot: fix blind item.type reference --- worlds/oot/Hints.py | 3 ++- worlds/oot/Patches.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/worlds/oot/Hints.py b/worlds/oot/Hints.py index 4250c559..b8ae7dfa 100644 --- a/worlds/oot/Hints.py +++ b/worlds/oot/Hints.py @@ -10,6 +10,7 @@ from urllib.error import URLError, HTTPError import json from enum import Enum +from .Items import OOTItem from .HintList import getHint, getHintGroup, Hint, hintExclusions from .Messages import COLOR_MAP, update_message_by_id from .TextBox import line_wrap @@ -480,7 +481,7 @@ def get_specific_item_hint(world, checked): def get_random_location_hint(world, checked): locations = list(filter(lambda location: is_not_checked(location, checked) - and location.item.type not in ('Drop', 'Event', 'Shop', 'DungeonReward') + and not (isinstance(location.item, OOTItem) and location.item.type in ('Drop', 'Event', 'Shop', 'DungeonReward')) # and not (location.parent_region.dungeon and isRestrictedDungeonItem(location.parent_region.dungeon, location.item)) # AP already locks dungeon items and not location.locked and location.name not in world.hint_exclusions diff --git a/worlds/oot/Patches.py b/worlds/oot/Patches.py index 177a4c61..91f656b4 100644 --- a/worlds/oot/Patches.py +++ b/worlds/oot/Patches.py @@ -5,6 +5,7 @@ import zlib from collections import defaultdict from functools import partial +from .Items import OOTItem from .LocationList import business_scrubs from .Hints import writeGossipStoneHints, buildAltarHints, \ buildGanonText, getSimpleHintNoPrefix @@ -1881,9 +1882,9 @@ def get_override_entry(player_id, location): type = 2 elif location.type == 'GS Token': type = 3 - elif location.type == 'Shop' and location.item.type != 'Shop': + elif location.type == 'Shop' and not (isinstance(location.item, OOTItem) and location.item.type == 'Shop'): type = 0 - elif location.type == 'GrottoNPC' and location.item.type != 'Shop': + elif location.type == 'GrottoNPC' and not (isinstance(location.item, OOTItem) and location.item.type == 'Shop'): type = 4 elif location.type in ['Song', 'Cutscene']: type = 5