mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-22 17:22:54 -04:00
Fix ganondorf hint (#6789)
Location indexes need to be aligned, so rather than try erase them, just avoid RC_UNKNOWN_CHECK crash by stubbing it to "an isolated place"
This commit is contained in:
@@ -757,12 +757,10 @@ void CreateStaticItemHint(RandomizerHint hintKey, std::vector<RandomizerHintText
|
||||
// RANDOTODO choose area in case there are multiple
|
||||
auto ctx = Rando::Context::GetInstance();
|
||||
std::vector<RandomizerCheck> locations = FindItemsAndMarkHinted(items, hintChecks);
|
||||
locations.erase(
|
||||
std::remove_if(locations.begin(), locations.end(), [](const auto rc) { return rc == RC_UNKNOWN_CHECK; }));
|
||||
std::vector<RandomizerArea> areas;
|
||||
areas.reserve(locations.size());
|
||||
for (auto loc : locations) {
|
||||
areas.push_back(ctx->GetItemLocation(loc)->GetRandomArea());
|
||||
areas.push_back(loc == RC_UNKNOWN_CHECK ? RA_NONE : ctx->GetItemLocation(loc)->GetRandomArea());
|
||||
}
|
||||
ctx->AddHint(hintKey, Hint(hintKey, HINT_TYPE_AREA, hintTextKeys, locations, areas, {}, yourPocket));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user