mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 10:52:19 -05:00
Makes merchant prices array size not depend on Rando Setting Values (#1860)
This commit is contained in:
parent
4adfb93b48
commit
a9f73ee641
@ -177,12 +177,7 @@ void SaveManager::LoadRandomizerVersion2() {
|
|||||||
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
|
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
|
||||||
|
|
||||||
size_t merchantPricesSize = 0;
|
size_t merchantPricesSize = 0;
|
||||||
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) {
|
SaveManager::Instance->LoadData("merchantPricesSize", merchantPricesSize);
|
||||||
merchantPricesSize += NUM_SCRUBS;
|
|
||||||
}
|
|
||||||
if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 0) {
|
|
||||||
merchantPricesSize += NUM_SHOP_ITEMS;
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveManager::Instance->LoadArray("merchantPrices", merchantPricesSize, [&](size_t i) {
|
SaveManager::Instance->LoadArray("merchantPrices", merchantPricesSize, [&](size_t i) {
|
||||||
SaveManager::Instance->LoadStruct("", [&]() {
|
SaveManager::Instance->LoadStruct("", [&]() {
|
||||||
@ -247,6 +242,7 @@ void SaveManager::SaveRandomizer() {
|
|||||||
merchantPrices.push_back(std::make_pair(check, price));
|
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->SaveArray("merchantPrices", merchantPrices.size(), [&](size_t i) {
|
||||||
SaveManager::Instance->SaveStruct("", [&]() {
|
SaveManager::Instance->SaveStruct("", [&]() {
|
||||||
SaveManager::Instance->SaveData("check", merchantPrices[i].first);
|
SaveManager::Instance->SaveData("check", merchantPrices[i].first);
|
||||||
|
Loading…
Reference in New Issue
Block a user