Makes merchant prices array size not depend on Rando Setting Values (#1860)

This commit is contained in:
Christopher Leggett 2022-10-26 15:57:14 -04:00 committed by GitHub
parent 4adfb93b48
commit a9f73ee641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,12 +177,7 @@ void SaveManager::LoadRandomizerVersion2() {
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
size_t merchantPricesSize = 0;
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) {
merchantPricesSize += NUM_SCRUBS;
}
if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 0) {
merchantPricesSize += NUM_SHOP_ITEMS;
}
SaveManager::Instance->LoadData("merchantPricesSize", merchantPricesSize);
SaveManager::Instance->LoadArray("merchantPrices", merchantPricesSize, [&](size_t i) {
SaveManager::Instance->LoadStruct("", [&]() {
@ -247,6 +242,7 @@ void SaveManager::SaveRandomizer() {
merchantPrices.push_back(std::make_pair(check, price));
}
SaveManager::Instance->SaveData("merchantPricesSize", merchantPrices.size());
SaveManager::Instance->SaveArray("merchantPrices", merchantPrices.size(), [&](size_t i) {
SaveManager::Instance->SaveStruct("", [&]() {
SaveManager::Instance->SaveData("check", merchantPrices[i].first);