From 82814b5b59ebfa697722780830d5d34190373b3f Mon Sep 17 00:00:00 2001 From: ScArWlvrne Date: Mon, 8 Jun 2026 23:31:19 -0700 Subject: [PATCH 1/3] fix: place Song of Time before removing songs from item pool to ensure it's put in a location in the category cNoOcarinaStart --- source/fill.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/fill.cpp b/source/fill.cpp index 1bfff0f..595c959 100644 --- a/source/fill.cpp +++ b/source/fill.cpp @@ -874,12 +874,12 @@ int Fill() { RandomizeDungeonItems(); CitraPrint("Trying to place songs"); - //Place Songs before inventory to prevent song locations from being used - //get Songs in pool - std::vector songs = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).GetItemType() == ITEMTYPE_SONG;}); + //If Shuffled in Song Locations restrict location pool to only song locations //If Song of Time is shuffled do that first with a restricted location pool to prevent softlocks + //Also makes sure that Song of Time isn't fitered out of the pool by building the songs vector + //first as was done in older versions if (ShuffleSongOfTime) { std::vector ocarinaLocations = FilterFromPool(allLocations, []( const LocationKey loc) {return Location(loc)->IsCategory(Category::cNoOcarinaStart);}); std::vector SoTItem = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) { return ItemTable(i).GetHintKey() == SONG_OF_TIME; }); @@ -897,6 +897,11 @@ int Fill() { AssumedFill(ocarinaItem, ocarinaLocations, true); NoRepeatOnTokens = false; } + + //get Songs in pool after placing Song of Time so it doesn't get placed + //in a location outside the cNoOcarinaStart category + std::vector songs = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).GetItemType() == ITEMTYPE_SONG;}); + //If Songs are at song locations get all song locations and place them there if (ShuffleSongs.Value() == u8(1)){ std::vector songLocations = FilterFromPool(allLocations, [](const LocationKey loc) {return Location(loc)->IsCategory(Category::cSong);}); From cb3cb7e3abc25cdb8ebac0592f0a321745219c28 Mon Sep 17 00:00:00 2001 From: ScArWlvrne Date: Mon, 8 Jun 2026 23:43:39 -0700 Subject: [PATCH 2/3] Revert "fix: place Song of Time before removing songs from item pool to ensure it's put in a location in the category cNoOcarinaStart" This reverts commit 82814b5b59ebfa697722780830d5d34190373b3f. Reverts an over-complicated bug fix --- source/fill.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/source/fill.cpp b/source/fill.cpp index 595c959..1bfff0f 100644 --- a/source/fill.cpp +++ b/source/fill.cpp @@ -874,12 +874,12 @@ int Fill() { RandomizeDungeonItems(); CitraPrint("Trying to place songs"); + //Place Songs before inventory to prevent song locations from being used - + //get Songs in pool + std::vector songs = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).GetItemType() == ITEMTYPE_SONG;}); //If Shuffled in Song Locations restrict location pool to only song locations //If Song of Time is shuffled do that first with a restricted location pool to prevent softlocks - //Also makes sure that Song of Time isn't fitered out of the pool by building the songs vector - //first as was done in older versions if (ShuffleSongOfTime) { std::vector ocarinaLocations = FilterFromPool(allLocations, []( const LocationKey loc) {return Location(loc)->IsCategory(Category::cNoOcarinaStart);}); std::vector SoTItem = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) { return ItemTable(i).GetHintKey() == SONG_OF_TIME; }); @@ -897,11 +897,6 @@ int Fill() { AssumedFill(ocarinaItem, ocarinaLocations, true); NoRepeatOnTokens = false; } - - //get Songs in pool after placing Song of Time so it doesn't get placed - //in a location outside the cNoOcarinaStart category - std::vector songs = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).GetItemType() == ITEMTYPE_SONG;}); - //If Songs are at song locations get all song locations and place them there if (ShuffleSongs.Value() == u8(1)){ std::vector songLocations = FilterFromPool(allLocations, [](const LocationKey loc) {return Location(loc)->IsCategory(Category::cSong);}); From b428bbc64c9d18e6274da17a2d5f7af426041c26 Mon Sep 17 00:00:00 2001 From: ScArWlvrne Date: Mon, 8 Jun 2026 23:50:16 -0700 Subject: [PATCH 3/3] fix: actually place Song of Time in a cNoOcarinaStart location --- source/fill.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/fill.cpp b/source/fill.cpp index 1bfff0f..2320c88 100644 --- a/source/fill.cpp +++ b/source/fill.cpp @@ -882,7 +882,8 @@ int Fill() { //If Song of Time is shuffled do that first with a restricted location pool to prevent softlocks if (ShuffleSongOfTime) { std::vector ocarinaLocations = FilterFromPool(allLocations, []( const LocationKey loc) {return Location(loc)->IsCategory(Category::cNoOcarinaStart);}); - std::vector SoTItem = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) { return ItemTable(i).GetHintKey() == SONG_OF_TIME; }); + //Pull Song of Time from songs pool instead of main pool so we actually get it placed first + std::vector SoTItem = FilterAndEraseFromPool(songs, [](const ItemKey i) { return ItemTable(i).GetHintKey() == SONG_OF_TIME; }); NoRepeatOnTokens = true; AssumedFill(SoTItem, ocarinaLocations, true); NoRepeatOnTokens = false;