Skip to content

Commit

Permalink
fix small hint issues (#4358)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepper0ni authored Sep 27, 2024
1 parent 159d087 commit 0f47e63
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions soh/soh/Enhancements/randomizer/3drando/hints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit 0f47e63

Please sign in to comment.