From 0f47e6394e5e9f9db91ca2a6489dbe8566fed2d2 Mon Sep 17 00:00:00 2001 From: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com> Date: Fri, 27 Sep 2024 01:35:20 +0100 Subject: [PATCH] fix small hint issues (#4358) --- soh/soh/Enhancements/randomizer/3drando/hints.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.cpp b/soh/soh/Enhancements/randomizer/3drando/hints.cpp index 9b22706cd..aca523072 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hints.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hints.cpp @@ -681,10 +681,12 @@ std::vector FindItemsAndMarkHinted(std::vector i return ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() == items[c];}); if (found.size() > 0){ locations.push_back(found[0]); - } - //RANDOTODO make the called functions of this always return true if empty hintChecks are provided - if (hintChecks.size() == 0 || (!ctx->GetItemLocation(found[0])->IsAHintAccessible() && IsReachableWithout(hintChecks,found[0],true))){ - ctx->GetItemLocation(found[0])->SetHintAccesible(); + //RANDOTODO make the called functions of this always return true if empty hintChecks are provided + if (!ctx->GetItemLocation(found[0])->IsAHintAccessible() && (hintChecks.size() == 0 || IsReachableWithout(hintChecks, found[0],true))){ + ctx->GetItemLocation(found[0])->SetHintAccesible(); + } + } else { + locations.push_back(RC_UNKNOWN_CHECK); } } return locations; @@ -730,10 +732,15 @@ void CreateStaticHintFromData(RandomizerHint hint, StaticHintInfo staticData){ Option option = ctx->GetOption(staticData.setting); if ((std::holds_alternative(staticData.condition) && option.Is(std::get(staticData.condition))) || (std::holds_alternative(staticData.condition) && option.Is(std::get(staticData.condition)))){ + std::vector locations = {}; if (staticData.targetItems.size() > 0){ locations = FindItemsAndMarkHinted(staticData.targetItems, staticData.hintChecks); } + for(auto check: staticData.targetChecks){ + ctx->GetItemLocation(check)->SetHintAccesible(); + } + //hintKeys are defaulted to in the hint object and do not need to be specified ctx->AddHint(hint, Hint(hint, staticData.type, {}, locations, {}, {}, staticData.yourPocket, staticData.num)); }