fix small hint issues (#4358)

This commit is contained in:
Pepper0ni 2024-09-27 01:35:20 +01:00 committed by GitHub
parent 159d0872d7
commit 0f47e6394e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -681,10 +681,12 @@ std::vector<RandomizerCheck> FindItemsAndMarkHinted(std::vector<RandomizerGet> i
return ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() == items[c];}); return ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() == items[c];});
if (found.size() > 0){ if (found.size() > 0){
locations.push_back(found[0]); locations.push_back(found[0]);
} //RANDOTODO make the called functions of this always return true if empty hintChecks are provided
//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))){
if (hintChecks.size() == 0 || (!ctx->GetItemLocation(found[0])->IsAHintAccessible() && IsReachableWithout(hintChecks,found[0],true))){ ctx->GetItemLocation(found[0])->SetHintAccesible();
ctx->GetItemLocation(found[0])->SetHintAccesible(); }
} else {
locations.push_back(RC_UNKNOWN_CHECK);
} }
} }
return locations; return locations;
@ -730,10 +732,15 @@ void CreateStaticHintFromData(RandomizerHint hint, StaticHintInfo staticData){
Option option = ctx->GetOption(staticData.setting); Option option = ctx->GetOption(staticData.setting);
if ((std::holds_alternative<bool>(staticData.condition) && option.Is(std::get<bool>(staticData.condition))) || 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::holds_alternative<uint8_t>(staticData.condition) && option.Is(std::get<uint8_t>(staticData.condition)))){
std::vector<RandomizerCheck> locations = {}; std::vector<RandomizerCheck> locations = {};
if (staticData.targetItems.size() > 0){ if (staticData.targetItems.size() > 0){
locations = FindItemsAndMarkHinted(staticData.targetItems, staticData.hintChecks); 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 //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)); ctx->AddHint(hint, Hint(hint, staticData.type, {}, locations, {}, {}, staticData.yourPocket, staticData.num));
} }