Skip to content

Conversation

@briaguya0
Copy link
Contributor

@briaguya0 briaguya0 commented May 17, 2025

#5486 changed a couple for loops in PareDownPlaythrough to use an unsigned size_t instead of a signed int. these loops iterate backwards (using i-- and j--), and rely on checking i >= 0/j >= 0. switching to signed caused these to underflow.

those loops have been around unchanged forever (followed the blame back to #416) - and i'm not sure why exactly they rely on iterating backwards but i didn't want to touch it when making this fix.

Build Artifacts

This was referenced May 17, 2025
@Pepper0ni
Copy link
Contributor

These iterate backwards because the logic looks to remove items from later spheres first to preserve the earliest way to get a given item. If they didn't iterate backwards, the playthrough would be a mess of all the latest ways to get items and things being in spheres before what unlocked them.

@briaguya0
Copy link
Contributor Author

that makes sense for the spheres themselves, less clear why that's happening for the locations within the spheres

@Pepper0ni
Copy link
Contributor

I can't think of a reason for the locations as everything within the same sphere has the same accessibility. That could be safely uninverted.

@Malkierian Malkierian merged commit 4f0ed29 into HarbourMasters:develop May 17, 2025
6 checks passed
krazyjakee pushed a commit to krazyjakee/OOT that referenced this pull request Sep 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants