From 0ab4f21382e0bbee7446d8505f57c0e49b6f9de4 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 5 Sep 2022 22:14:39 -0500 Subject: [PATCH 1/3] Fix issue when merchantPrices is empty --- soh/soh/SaveManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 1fea00767..a3a3ccd64 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -155,7 +155,7 @@ void SaveManager::SaveRandomizer() { merchantPrices.push_back(std::make_pair(check, price)); } - SaveManager::Instance->SaveArray("merchantPrices", NUM_SCRUBS, [&](size_t i) { + SaveManager::Instance->SaveArray("merchantPrices", merchantPrices.size(), [&](size_t i) { SaveManager::Instance->SaveStruct("", [&]() { SaveManager::Instance->SaveData("check", merchantPrices[i].first); SaveManager::Instance->SaveData("price", merchantPrices[i].second); From c9c648322d9aeaf0557b69fa5432ae0627f0ec57 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 5 Sep 2022 22:30:39 -0500 Subject: [PATCH 2/3] Fix for a single zeroed merchantPrice entry --- soh/soh/SaveManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index a3a3ccd64..1fef30214 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -94,7 +94,13 @@ void SaveManager::LoadRandomizerVersion1() { std::shared_ptr randomizer = OTRGlobals::Instance->gRandomizer; - SaveManager::Instance->LoadArray("merchantPrices", NUM_SCRUBS, [&](size_t i) { + size_t merchantPricesSize = 0; + if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) { + merchantPricesSize += NUM_SCRUBS; + } + // TODO: Add shop item count when shopsanity is enabled + + SaveManager::Instance->LoadArray("merchantPrices", merchantPricesSize, [&](size_t i) { SaveManager::Instance->LoadStruct("", [&]() { RandomizerCheck rc; SaveManager::Instance->LoadData("check", rc); From a99330a8a51661620a638401f5f8817617a1e350 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 5 Sep 2022 23:28:32 -0500 Subject: [PATCH 3/3] Fix #1417 --- soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index a6ddb5844..c6709e144 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -349,6 +349,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) { this->getItemId = GI_BULLET_BAG_50; } } else { + this->getItemEntry = (GetItemEntry)GET_ITEM_NONE; this->getItemId = GI_RUPEE_PURPLE; } } else { @@ -371,6 +372,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) { break; } } else { + this->getItemEntry = (GetItemEntry)GET_ITEM_NONE; this->getItemId = GI_RUPEE_PURPLE; } }