Fix learning Saria's song multiple times#2573
Merged
Merged
Conversation
fenhl
approved these changes
May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure flag for learning Saria's song gets set for no double song learning. Fixes #239.
The
set_saria_song_flaghook is in the action function that Saria switches to after a cutscene ends (in decomp,func_80AF68E4intofunc_80AF6B20), placed there presumably because that's where player receives the song item in vanilla. There is a one frame window after the cutscene where player can pause, save and quit, and will have received the song but not the flag, and will learn the song again on next SFM visit.The fix moves the hook to the previous action function (i.e. one frame earlier) and checks for the same condition as the old function (that the scene is SFM).
I would really have liked to put it at cutscene start (as part of
override_saria_song_check) together with receiving the item so that item and flag are handled together at the start for ease of modifying, because it's impossible anyway for player to save and quit out of a cutscene to shorten it (barring voiding out). I couldn't figure the Python out though and moving the flag there by itself risks player losing the check if voiding out before receiving the song.Disassembly
NTSC 1.0 matching disassembly for
func_80AF68E4hereSaria actor decomp code En_Sa
Testing
Tested in Ares recent nightly build and Project64 3.0.1
Looks like this: https://www.youtube.com/watch?v=o0oshMtzxH8
Tested both songs as songs and songs as items.
0x8011b4af is flag address. Pause on holding D left: