From aa35afcfaceaad2be3cc185ed4d15d83961b57b9 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Mon, 2 Feb 2026 17:49:29 -0500 Subject: [PATCH 1/3] Fix calculation for heart pieces/containers to add. This calc ends up with 8 heart containers in the pool with the default 3 starting hearts, just like the 8 heart containers in the vanilla game. Changing starting hearts results in half of the remaining hearts being filled by heart containers and half of the remaining hearts being filled by heart pieces. --- soh/soh/Enhancements/randomizer/3drando/item_pool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index e48f30d61af..bf26a48ce0e 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -871,9 +871,13 @@ void GenerateItemPool() { break; case RO_ITEM_POOL_BALANCED: { int heartsToPlace = maxHearts - startingHearts; - int halfHearts = maxHearts >> 2; + int halfHearts = heartsToPlace / 2; AddFixedItemToPool(RG_HEART_CONTAINER, heartsToPlace - halfHearts, false); AddFixedItemToPool(RG_PIECE_OF_HEART, halfHearts * 4, false); + if (halfHearts % 2 == 1) { + // If startingHearts was odd, we only have enough for 19 hearts at this point, add 4 extra heart pieces + AddFixedItemToPool(RG_PIECE_OF_HEART, 4, false); + } break; } case RO_ITEM_POOL_SCARCE: From 8221f4f3491e504d6a27db3082010a43398d20af Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Mon, 2 Feb 2026 20:04:44 -0500 Subject: [PATCH 2/3] Fix my math error this time --- soh/soh/Enhancements/randomizer/3drando/item_pool.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index bf26a48ce0e..b77cbe59c08 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -874,11 +874,6 @@ void GenerateItemPool() { int halfHearts = heartsToPlace / 2; AddFixedItemToPool(RG_HEART_CONTAINER, heartsToPlace - halfHearts, false); AddFixedItemToPool(RG_PIECE_OF_HEART, halfHearts * 4, false); - if (halfHearts % 2 == 1) { - // If startingHearts was odd, we only have enough for 19 hearts at this point, add 4 extra heart pieces - AddFixedItemToPool(RG_PIECE_OF_HEART, 4, false); - } - break; } case RO_ITEM_POOL_SCARCE: AddFixedItemToPool(RG_PIECE_OF_HEART, (maxHearts - startingHearts) * 4, false); From 41a9a2b4e3fd78d07bdf148ab352b64d61b84e25 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Tue, 3 Feb 2026 07:16:52 -0500 Subject: [PATCH 3/3] Readd missing break; statement --- soh/soh/Enhancements/randomizer/3drando/item_pool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index b77cbe59c08..15ccebba77d 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -874,6 +874,7 @@ void GenerateItemPool() { int halfHearts = heartsToPlace / 2; AddFixedItemToPool(RG_HEART_CONTAINER, heartsToPlace - halfHearts, false); AddFixedItemToPool(RG_PIECE_OF_HEART, halfHearts * 4, false); + break; } case RO_ITEM_POOL_SCARCE: AddFixedItemToPool(RG_PIECE_OF_HEART, (maxHearts - startingHearts) * 4, false);