fix(cheats): Teleport and Switch age no longer leave the minimap hidden for good (#2217) #2402
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2402
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/teleport-minimap-flag"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Debug tab's Teleport and Switch age can leave a save with no minimap in any area, for good (#2217).
Why
An area that hides the minimap while Link is in it sets the game's
MapIconDeactivateByAreaActorflag and shows the minimap again as he walks out. The flag is saved. The cheats' map change (oot_teleport, which Switch age goes through too) takes him out of the area without that, so the flag stays set: no minimap anywhere from then on, in that save and every save made from it. Zarigis found the flag and confirmed it with a save editor in the issue.The change
oot_teleportclears the flag once the game's event manager takes its request, and logs a line when it was set:A teleport that is refused (an event is playing, a map is loading, a request from a moment ago is still in progress), or that the event manager answers with 0 (it did not take it, and the map does not change), leaves the flag alone: Link is still in the area. A save the flag is already stuck in is mended by its next teleport.
Tested
tests/test_teleport_minimap_flag.py(new, Linux) buildsoot_teleportand what it calls fromhost/hos_main.cas it is, over a stand-in for the game (its flags' table, its event manager, the five game functions the teleport calls): a teleport that is sent clears the flag and logs the line; with the flag clear nothing is written or said; a refused or ignored teleport, and one the event manager answers with 0, leaves it. Onmainit fails with "a teleport out of an area that hid the minimap left it hidden".python -I -B tests/run_all.py: nothing new fails.mainthe flag is still 1 after arriving in Gerudo Valley. With this change the log has the line above at the teleport, the flag goes 1 -> 0 as the request is taken (the event manager's answer is 1), and it is 0 after arriving.Not tested: a real area that hides the minimap (the flag was set by hand, in an area that does not set it); Switch age (it goes through the same function); a look at the screen with a save that has lost its minimap; Linux in the game.
Fixes #2217
Nice find and a tidy fix. I read the diff against the full
oot_teleport:*c = saved, so the GameData lookups run with the caller's registers, and it only fires whenok && result, so a refused or declined request (event playing, map loading, request in progress, event manager answering 0) leaves the flag alone, as the body says. Switch age goes throughoot_teleport, so it is covered too.oot_gamedata_set_boolalready exists (used by the age toggle); the new forward declaration is all that was needed. The flag hash is the same kind of name hash as theSequence_IsChildhood/IsLoadingBancones already in the file, and the post only names the flag the issue already named. No game files or game-derived data are added: the test's stand-in game is built from addresses and hashes the source already has.oot_teleportout ofhost/hos_main.cand covers the sent, no-op, refused, ignored and answer-0 cases. It prints SKIP on Windows/macOS, and no game is needed in CI.Not verified by me: I did not build or run it. The in-game check was with the flag set by hand, as the PR says, so a real flag-hiding area and the Linux run are still untested; that is fine for a fix this small.
Separate from #2371 (pictures on the Teleport page), which touches the page and not this function. CI was still running when I looked; the Windows build passed.
The red checks aren't this PR's. Windows part 1 is
test_native_astc_texture_count.py, which #2397 fixed on main after this run. The appimage failure was three Launchpad PPA timeouts. The fix only runs when the request was taken (ok && result, after*c = saved), and the test cuts the realoot_teleportfrom the source. A re-run or branch update should go green.github-sync referenced this pull request2026-11-12 06:22:54 +00:00