fix a V2 compatibility crash (#4119)

* Attempt to fix ambiguity issues and a V2 compatibility crash

* oops

* remove explicit call as it is fixed elsewhere
This commit is contained in:
Pepper0ni 2024-05-06 20:10:00 +01:00 committed by GitHub
parent a96fe678f8
commit d0627dc737
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,7 +102,7 @@ std::vector<RandomizerHint> Rando::StaticData::oldVerHintOrder {
RH_ZR_OPEN_GROTTO_GOSSIP_STONE,
};
uint16_t Rando::StaticData::oldVerGossipStoneStart = 740;
uint16_t Rando::StaticData::oldVerGossipStoneStart = 706;
SaveManager::SaveManager() {
coreSectionIDsByName["base"] = SECTION_ID_BASE;
@ -188,7 +188,7 @@ void SaveManager::LoadRandomizerVersion1() {
for (int j = 0; j < ARRAY_COUNT(hintText); j++) {
SaveManager::Instance->LoadData("ht" + std::to_string(i) + "-" + std::to_string(j), hintText[j]);
}
RandomizerHint stoneHint = Rando::StaticData::oldVerHintOrder[Rando::StaticData::oldVerGossipStoneStart];
RandomizerHint stoneHint = Rando::StaticData::oldVerHintOrder[i - Rando::StaticData::oldVerGossipStoneStart];
randoContext->AddHint(stoneHint, Rando::Hint(stoneHint, {CustomMessage(hintText)}));
}
@ -294,7 +294,7 @@ void SaveManager::LoadRandomizerVersion2() {
if (rc != RC_UNKNOWN_CHECK) {
std::string hintText;
SaveManager::Instance->LoadData("hintText", hintText);
RandomizerHint stoneHint = Rando::StaticData::oldVerHintOrder[Rando::StaticData::oldVerGossipStoneStart];
RandomizerHint stoneHint = Rando::StaticData::oldVerHintOrder[rc - Rando::StaticData::oldVerGossipStoneStart];
randoContext->AddHint(stoneHint, Rando::Hint(stoneHint, {CustomMessage(hintText)}));
}
});