From af485bf64c3f815e52df3b19ff51e90fcc429223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= <159546+serprex@users.noreply.github.com> Date: Sun, 9 Aug 2026 02:07:06 +0000 Subject: [PATCH] Fix bugs in hints (#7046) 1. fix filtering trials hints when only 1-3 required 2. clearing names per iteration won't work with dual hints --- soh/soh/Enhancements/randomizer/3drando/hints.cpp | 4 ++-- soh/soh/Enhancements/randomizer/hint.cpp | 7 ++++--- soh/soh/resource/type/Scene.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.cpp b/soh/soh/Enhancements/randomizer/3drando/hints.cpp index f16b88a1aa..39134196ea 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hints.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hints.cpp @@ -480,8 +480,8 @@ static void CreateTrialHints(uint8_t copies) { ctx->GetTrials()->GetTrialList(); // there's probably a way to remove this assignment if (ctx->GetOption(RSK_TRIAL_COUNT).Get() >= 4) { // 4 or 5 required trials, get skipped trials trials = FilterFromPool(trials, [](TrialInfo* trial) { return trial->IsSkipped(); }); - } else { // 1 to 3 trials, get requried trials - auto requiredTrials = FilterFromPool(trials, [](TrialInfo* trial) { return trial->IsRequired(); }); + } else { // 1 to 3 trials, get required trials + trials = FilterFromPool(trials, [](TrialInfo* trial) { return trial->IsRequired(); }); } for (auto& trial : trials) { // create a hint for each hinted trial AddGossipStoneHintCopies(copies, HINT_TYPE_TRIAL, "Trial", {}, {}, {}, { trial->GetTrialKey() }); diff --git a/soh/soh/Enhancements/randomizer/hint.cpp b/soh/soh/Enhancements/randomizer/hint.cpp index 3079bb040c..4b8383b765 100644 --- a/soh/soh/Enhancements/randomizer/hint.cpp +++ b/soh/soh/Enhancements/randomizer/hint.cpp @@ -181,9 +181,10 @@ void Hint::NamesChosen() { } if (hintType == HINT_TYPE_ITEM || hintType == HINT_TYPE_ITEM_AREA) { + namesTemp.clear(); + saveNames = false; + for (size_t c = 0; c < locations.size(); c++) { - namesTemp = {}; - saveNames = false; uint8_t selection = GetRandomHintTextEntry(GetItemHintText(static_cast(c))); if (selection > 0) { saveNames = true; @@ -197,7 +198,7 @@ void Hint::NamesChosen() { if (hintType == HINT_TYPE_FOOLISH || hintType == HINT_TYPE_ITEM_AREA || hintType == HINT_TYPE_WOTH || hintType == HINT_TYPE_ALTAR_CHILD || hintType == HINT_TYPE_ALTAR_ADULT) { - namesTemp = {}; + namesTemp.clear(); saveNames = false; for (uint8_t c = 0; c < areas.size(); c++) { diff --git a/soh/soh/resource/type/Scene.cpp b/soh/soh/resource/type/Scene.cpp index 9b93e4aeaa..bd7313de20 100644 --- a/soh/soh/resource/type/Scene.cpp +++ b/soh/soh/resource/type/Scene.cpp @@ -2,7 +2,7 @@ namespace SOH { void* Scene::GetPointer() { - // Scene is a special type that requries C++ processing. As such, we return nothing. + // Scene is a special type that requires C++ processing. As such, we return nothing. return nullptr; }