fix(cheats): Teleport and Switch age no longer leave the minimap hidden for good (#2217) #2402

Merged
jarynclouatre merged 1 commit from fix/teleport-minimap-flag into main 2026-11-11 21:30:15 +00:00
jarynclouatre commented 2026-11-11 17:25:58 +00:00 (Migrated from github.com)

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 MapIconDeactivateByAreaActor flag 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_teleport clears the flag once the game's event manager takes its request, and logs a line when it was set:

cheats: teleport: the area left had hidden the minimap (MapIconDeactivateByAreaActor): shown again

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) builds oot_teleport and what it calls from host/hos_main.c as 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. On main it 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.
  • In the game (Windows 11, RTX 4070 Ti SUPER, headless, a scripted run): teleport to Hyrule Field, the flag set there by hand (a local debug build that writes it and logs its value; that patch is not part of this change), then teleport to Gerudo Valley. On main the 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

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 `MapIconDeactivateByAreaActor` flag 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_teleport` clears the flag once the game's event manager takes its request, and logs a line when it was set: ``` cheats: teleport: the area left had hidden the minimap (MapIconDeactivateByAreaActor): shown again ``` 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) builds `oot_teleport` and what it calls from `host/hos_main.c` as 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. On `main` it 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. - In the game (Windows 11, RTX 4070 Ti SUPER, headless, a scripted run): teleport to Hyrule Field, the flag set there by hand (a local debug build that writes it and logs its value; that patch is not part of this change), then teleport to Gerudo Valley. On `main` the 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
hckrman101 (Migrated from github.com) approved these changes 2026-11-11 17:34:32 +00:00
hckrman101 (Migrated from github.com) left a comment

Nice find and a tidy fix. I read the diff against the full oot_teleport:

  • The clear sits after *c = saved, so the GameData lookups run with the caller's registers, and it only fires when ok && 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 through oot_teleport, so it is covered too.
  • oot_gamedata_set_bool already 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 the Sequence_IsChildhood / IsLoadingBanc ones 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.
  • The test cuts the real oot_teleport out of host/hos_main.c and 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.

Nice find and a tidy fix. I read the diff against the full `oot_teleport`: - The clear sits after `*c = saved`, so the GameData lookups run with the caller's registers, and it only fires when `ok && 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 through `oot_teleport`, so it is covered too. - `oot_gamedata_set_bool` already 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 the `Sequence_IsChildhood` / `IsLoadingBanc` ones 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. - The test cuts the real `oot_teleport` out of `host/hos_main.c` and 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.
Joey-Magnus (Migrated from github.com) approved these changes 2026-11-11 21:22:34 +00:00
Joey-Magnus (Migrated from github.com) left a comment

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 real oot_teleport from the source. A re-run or branch update should go green.

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 real `oot_teleport` from the source. A re-run or branch update should go green.
Commenting is not possible because the repository is archived.
No description provided.