From 3ca248a96a662945bd80be80851c4c4162894a21 Mon Sep 17 00:00:00 2001 From: Phlex <3514085+PhlexPlexico@users.noreply.github.com> Date: Mon, 28 Sep 2026 10:32:11 -0600 Subject: [PATCH 1/2] nit: Update Z3DR. fix: Fix Spoiler log generation. Playthrough includes hidden locations still which hit the playthroughItemNotFound, which was causing potential issues with sphere generation as well. --- Z3DR | 2 +- source/spoiler_log.cpp | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Z3DR b/Z3DR index bc4e460..c283bf9 160000 --- a/Z3DR +++ b/Z3DR @@ -1 +1 @@ -Subproject commit bc4e460064f4b6a462d4df5780097f86cbb1689b +Subproject commit c283bf93116dcd4845bb7f6ae056e2f27c183518 diff --git a/source/spoiler_log.cpp b/source/spoiler_log.cpp index 83198d1..2da35a6 100644 --- a/source/spoiler_log.cpp +++ b/source/spoiler_log.cpp @@ -360,15 +360,16 @@ static void WriteIngameSpoilerLog() { spoilerData.ItemLocationsCount = spoilerTotalItems; if (Settings::IngameSpoilers) { - bool playthroughItemNotFound = false; // Write playthrough data to in-game spoiler log if (!spoilerOutOfSpace) { + u32 sphere = 0; for (u32 i = 0; i < playthroughLocations.size(); i++) { - if (i >= SPOILER_SPHERES_MAX) { + if (sphere >= SPOILER_SPHERES_MAX) { spoilerOutOfSpace = true; break; } - spoilerData.Spheres[i].ItemLocationsOffset = spoilerSphereItemoffset; + spoilerData.Spheres[sphere].ItemLocationsOffset = spoilerSphereItemoffset; + spoilerData.Spheres[sphere].ItemCount = 0; for (u32 loc = 0; loc < playthroughLocations[i].size(); ++loc) { if (spoilerSphereItemoffset >= SPOILER_ITEMS_MAX) { spoilerOutOfSpace = true; @@ -378,15 +379,16 @@ static void WriteIngameSpoilerLog() { const auto foundItemLoc = itemLocationsMap.find(playthroughLocations[i][loc]); if (foundItemLoc != itemLocationsMap.end()) { spoilerData.SphereItemLocations[spoilerSphereItemoffset++] = foundItemLoc->second; - } else { - playthroughItemNotFound = true; - } - ++spoilerData.Spheres[i].ItemCount; + } + ++spoilerData.Spheres[sphere].ItemCount; + } + if (spoilerData.Spheres[sphere].ItemCount > 0) { + ++sphere; } - ++spoilerData.SphereCount; } + spoilerData.SphereCount = sphere; } - if (spoilerOutOfSpace || playthroughItemNotFound) { + if (spoilerOutOfSpace) { printf("%sError!%s ", YELLOW, WHITE); } } From 0cc145d9c0d97dcb12442015a75af2d345d47bd5 Mon Sep 17 00:00:00 2001 From: Phlex <3514085+PhlexPlexico@users.noreply.github.com> Date: Mon, 28 Sep 2026 10:50:51 -0600 Subject: [PATCH 2/2] nit: Remove the for loop and use const instead of i. --- source/spoiler_log.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/source/spoiler_log.cpp b/source/spoiler_log.cpp index 2da35a6..cbd31a7 100644 --- a/source/spoiler_log.cpp +++ b/source/spoiler_log.cpp @@ -362,28 +362,34 @@ static void WriteIngameSpoilerLog() { if (Settings::IngameSpoilers) { // Write playthrough data to in-game spoiler log if (!spoilerOutOfSpace) { + // Locations hidden from the item list above (vanilla tokens and stray fairies, alternate + // checks, ...) can still be in the playthrough. Leave them out here too; a sphere made only + // of hidden locations is dropped rather than shown empty. u32 sphere = 0; - for (u32 i = 0; i < playthroughLocations.size(); i++) { + for (const std::vector& sphereLocations : playthroughLocations) { if (sphere >= SPOILER_SPHERES_MAX) { spoilerOutOfSpace = true; break; } spoilerData.Spheres[sphere].ItemLocationsOffset = spoilerSphereItemoffset; spoilerData.Spheres[sphere].ItemCount = 0; - for (u32 loc = 0; loc < playthroughLocations[i].size(); ++loc) { + for (const LocationKey key : sphereLocations) { if (spoilerSphereItemoffset >= SPOILER_ITEMS_MAX) { spoilerOutOfSpace = true; break; } - const auto foundItemLoc = itemLocationsMap.find(playthroughLocations[i][loc]); + const auto foundItemLoc = itemLocationsMap.find(key); if (foundItemLoc != itemLocationsMap.end()) { spoilerData.SphereItemLocations[spoilerSphereItemoffset++] = foundItemLoc->second; - } - ++spoilerData.Spheres[sphere].ItemCount; + ++spoilerData.Spheres[sphere].ItemCount; + } } if (spoilerData.Spheres[sphere].ItemCount > 0) { - ++sphere; + ++sphere; + } + if (spoilerOutOfSpace) { + break; } } spoilerData.SphereCount = sphere;