No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2678
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/mod-api-first-night"
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?
Summary
The port of #2655 to
mod-api. Adult Link's clock can stay at 20:00 for good in Hyrule Field: the Sun's Song and Debug tools > Set time change it for a moment, then it snaps back (#1064, #2636).mod-api's repair,first_night_fixingame/crates/game-core/src/travel.rs, is a straight port of main's #2298 version and has its three faults: it skips Hyrule Field, where players are stuck; it writes the flag's live byte only, so the save keeps the lock and every load needs the repair again; and it calls the flag by another flag's name.The game holds the clock while quest
Meet_DekuTreeis notReadyand the saved BoolHrlField_HasEnteredFirstTime_Adult(0x8592aa82) is 1. The Temple of Time's event (Dm_TimeTemple_0055) sets it when Link becomes adult; the only thing that clears it is the arrival eventDm_SY_BancChangeArrive_HyruleField_02, when adult Link walks out of the Market's main gate onto the field. Every other way into the field (a warp song, Farore's Wind, the Debug tab's teleport, a save made in the field with the Bool set) keeps the lock. The findings are in #2655's description.This does what #2655 does on main, in Rust:
first_night_rule: clear the Bool anywhere but where the game keeps the lock itself (the Market's maps, which hold the Temple of Time, and the Chamber of SagesSageRoom, with Link adult or his age not read), never while an event plays (the field's arrival event clears it itself);first_night_fixclears it through the game's own Bool setter,GameData::set_bool_queued, as the teleport's minimap repair in the same file does, so the save's copy is cleared too. A game build without the setter is said once in the log and the Bool is left;HOS_GAME_FIRST_NIGHT_FIX's row ingpu/vk/switches.defgive the Bool's real name: #2298 called 0x8592aa82HrlField_isFirstNightTime_Adult, which is another Bool (0xf1024b60) that the clock never reads.Why it stays a flag clear and not a hook on the lock's check: blocking the Temple's set would take away the game's own first night, and a check that ignores the Bool outside the Market would leave it in the save, so the clock would hold again whenever adult Link is in the Market's maps later (Prelude of Light lands in the Temple).
How to see it on
mod-api: load an adult save in Hyrule Field with 0x8592aa82 set to 1 (the repository'scastle-gatesave with it andHyruleField_ArriveEntrance0x804aec99 set to 1 inprogress.sav); the clock stays at 20:00 and the log has noclearedline.Files to read first:
game/crates/game-core/src/travel.rs(first_night_rule,first_night_fix, and the testthe_first_nights_lock_is_cleared_away_from_the_temple_and_the_ruined_market),gpu/vk/switches.def.See #1064, #2636, #2655 (the same fix on main).
Testing
Tested: not in the game on this branch: opened without a run, at the request of the person I work for. The same rule and the same setter call ran in the game on main in #2655 (Windows 11, Ryzen 9 3900X, RTX 3080, driver 621.14, castle-gate with the Bool set): the repair off held the clock at 72000 (20:00), on cleared the Bool and the clock ran (72259 → 74700 in 20 s).
cargo test -p game-core --lib travel::on Windows (Rust 1.99.1 gnullvm, llvm-mingw): 15 passed, the new one among them. It covers each case of main'stests/test_oot_first_night.py: Hyrule Field (both map names) and another map cleared; the Market's maps and SageRoom as adult left; the Market with the age not read left, the field with it not read cleared; the Market as a child cleared; the Bool already clear or not read, an empty map, an event playing: left; no setter: nothing written. And the Bool's name:flags::hash("HrlField_HasEnteredFirstTime_Adult")is 0x8592aa82,HrlField_isFirstNightTime_Adult's is not.mod-api's rule before this), the Market or SageRoom exemption taken out, the age test inverted, an unread age clearing in the Market, the event check dropped, the Bool not read first, a missing setter ignored, an empty map cleared.cargo fmt -p game-core --checkandcargo clippy -p game-core --all-targets -- -D warnings: clean.mise run test), and the game built from this branch.Still to test:
castle-gatewith 0x8592aa82 and 0x804aec99 set to 1 inprogress.sav: the clock runs in Hyrule Field and the log hasgame: cleared the first adult night's time lockonce; withHOS_GAME_FIRST_NIGHT_FIX=0it stays at 20:00 (by hand, or@Beanstalk).HOS_GAME_FIRST_NIGHT_FIX=0(by hand).clearedline in the Market (by hand).Measurements
Nothing to measure: a correctness fix; the repair reads one flag twice a second from the refresh that already ran it.
Risks
The repair now calls the game's own Bool setter from the inventory refresh, as the teleport's minimap repair and the Inventory editor's songs do from the game's thread;
refresh_inventoryalready had theGuestCtxit needs. In the Market's maps and the Chamber of Sages it leaves the Bool alone with Link adult, wheremod-api's repair cleared it, so the game's own first night in the ruined Market holds again until the gate.HOS_GAME_FIRST_NIGHT_FIX=0turns the repair off; a revert is enough. No save format, options or cache changes.Checklist
Ready for review
mod-api(d342b879e); the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (game-core's tests, rustfmt and clippy here; the full suite not run.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (Onmod-api's rule: its Hyrule Field skip, put back as a mutation, fails the test.)gpu/vk/switches.def. (The row's text: what the repair covers and the Bool's name; it stayskill, on by default.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
dubzilla referenced this pull request2026-11-27 21:16:11 +00:00
WIP: fix(game): the first adult night's time lock is cleared in Hyrule Field too, through the game's setter (#1064, #2636)to fix(game): the first adult night's time lock is cleared in Hyrule Field too, through the game's setter (#1064, #2636)