fix(debug): the flight lets Link go for events and respawns #2050
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!2050
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/flight-yields-to-events"
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?
Changes
Two fixes to the Debug tab's flight, both from playing with it on.
The first: an event that takes Link (a map change, the age toggle's reload, a cutscene) waits for him to stand, and the flight moves him to its own position every tick, so he never stood. Flying into an area's exit or toggling his age in the air left the screen black until the flight was switched off. A teleport sent from the Debug tab while flying could do the same, and a second request logged "teleport waits until the current event ends". While the event manager has an event playing, the flight now lets him go, so he lands and the event goes on. When it has ended the flight takes him again from where he stands.
The second: a respawn after a fall, or a warp, keeps Link's actor, so the flight put him straight back where it had him, over the same drop. With the flight on at an owl cutscene he fell, respawned and fell again until it was switched off. When he is more than 2 units from where the flight last placed him (it moves him 4 a second), the game moved him, and the flight starts again from there.
tests/test_flight_yields_to_events.pychecks both pieces of the host code.Testing
RTX 4070 Ti SUPER, driver 621.14, Windows 11.
Build: the Windows game builds with these two commits on
fc375e9plus #2020 (the samehost/hos_main.cas this branch apart from #2020's conflict, resolved by keeping both functions).test_flight_yields_to_events,test_movement_speedandtest_input_backgroundpass on Linux.Play, on that build: flying, teleported from the Debug tab to Sacred Forest Meadow as adult. Link landed, the map loaded and the picture was normal. On the build before, the same kind of map change while flying gave a black screen until the flight was switched off, several times in one session.
Not tested in play yet: the respawn case (the owl), and flying into an exit or toggling age in the air on the fixed build.
Read through it and it holds together. Letting
flyinggo to 0 whileoot_event_playingis true also clearsflying_actor, so the flight re-seeds from where Link stands when the event ends, and the earlyif (!flying && action != 2 && action != 3) return;leaves him alone in between. The event test is the sameevents + 104the teleport already uses, so the "waits until the current event ends" path and the new yield agree. The new test checks the order of the pieces, which is about all a game-free check can do here.Two small things, neither blocking:
target. That relies onchange_positionhaving been applied to the actor by the next tick. At 4 units a second the lag is far under 2 units, but the "return to mark" action (3) while flying can jumptargetfar away in one tick. If the actor position only updates after the physics step, the next tick would read the old position, see it more than 2 units fromtarget, and re-seed there, which would cancel the return. I could not tell that from the source, so I would try mark then return while flying when you next have the game up.CI: the only red check is
tests/test_display_startup_failure.py(driver_cache_roomundeclared, in the Vulkan code), on both the Ubuntu and Windows part 1 jobs. This PR does not touch that area, so I am not blaming it. The new test and everything else passes.github-sync referenced this pull request2026-11-12 06:22:54 +00:00