summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPepper0ni <93387759+Pepper0ni@users.noreply.github.com>2024-09-27 01:35:20 +0100
committerGitHub <noreply@github.com>2024-09-26 17:35:20 -0700
commit0f47e6394e5e9f9db91ca2a6489dbe8566fed2d2 (patch)
tree3094fbb5705e82c68dd56e3cd1b87cee8bc0d09c
parent159d0872d71c095f36e90629ecfb43880a77a753 (diff)
fix small hint issues (#4358)
-rw-r--r--soh/soh/Enhancements/randomizer/3drando/hints.cpp15
1 files 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<RandomizerCheck> FindItemsAndMarkHinted(std::vector<RandomizerGet> 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<bool>(staticData.condition) && option.Is(std::get<bool>(staticData.condition))) ||
(std::holds_alternative<uint8_t>(staticData.condition) && option.Is(std::get<uint8_t>(staticData.condition)))){
+
std::vector<RandomizerCheck> 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));
}