feat(mod-api): player.kill() defeats Link through the game's own hit #3143

Merged
llun merged 5 commits from glinesbdev/Longshot:feat/mod-api-player-kill into main 2026-12-04 05:39:07 +00:00
Contributor

Summary

A mod had no way to defeat Link. player.set({ life: 0 }) is taken, but his life component is written as the game writes it (write_life clamps to 1), so he is left at a quarter heart; actors.damage refuses Link. Writing 0 directly would skip the heart protection and the times the game takes no hit (some cutscenes), and a mod that subtracts life could kill him by surprise.

player.kill() makes the deadly hit actors.damage already makes (a one-shot internal hit registered with the life component's own damage calculator, as a fall's), on Link's actor and from himself. The game takes it through its own life check: his death plays, then a fairy or the game over, and whatever keeps him from a hit keeps him from this one.

  • Permission state.write, feature player.kill. Returns false outside play (a conversation, a cutscene, a menu, a load), with no Link, or with his life at 0.
  • A hit he does not take (a write not taken within three frames is dropped) is made again every 10 frames, up to 12 hits, until his life is 0; it stops when its mod stops, and logs a warning if he never fell.
  • The core takes a hit by address only for Link, from himself, while his life is above 0 (link_can_fall); every other hit is still by a listed actor that can take one.
  • player.set's doc now says a life of 0 leaves him at 1, and to use kill(); writes.md's open question about a life of 0 is answered.

Read first: player_kill, PlayerKill, player_kill_next and player_kill_step in game/crates/api/src/services/actors.rs; queue and link_can_fall in game/crates/game-core/src/actors/writes.rs; kill in game/modapi/schema/player.toml.

Open question: the mods' damage rules (rules.damageTaken) apply to this hit as to any hit, so a rule capping the damage would turn a kill into a smaller hit. Should kill() pass them by?

Testing

Tested: Windows 10 Home 22H2, AMD Radeon (RDNA3), driver 26.11.2. A mod (made with Ocarina Forge's blocks) calls player.kill() when a game flag turns on, in play in Kokiri Forest (child) with a bottled fairy: Link fell with his own death animation and the fairy revived him, as from any defeat. With no fairy, he fell and the game over screen followed. With the Cheats mod's heart protection on, he took no damage (he flashed red, as from a blocked hit) and lived, and the log said player.kill: Link did not fall after 12 hits (the game took none). Called directly from a conversation that sets the flag (log.info(`player.kill() returned ${player.kill()}`)), it returned false four times and Link was unharmed, during the conversation and after it. Checks: cargo test -p api -p game-core --lib (one new test, a_kill_is_hit_again_every_ten_frames_until_link_falls_and_waits_outside_play), clippy -D warnings, rustfmt, schema-gen --check. watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree fails, and fails on main too; fixes::barrier::tests::an_or_and_its_wake_end_a_wait_on_another_thread failed once and passed three times alone. mise run test not run in full.

Still to test: None.

Measurements

Nothing to measure: one API call; with no kill pending, the per-frame step returns at once.

Risks

A mod with state.write can now defeat Link, as the game's own hit would, and only in play; the heart protection still keeps him. A revert is enough; nothing changes for players or saves.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). — not run in full; the api and game-core tests are, with the failures named above.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.
## Summary A mod had no way to defeat Link. `player.set({ life: 0 })` is taken, but his life component is written as the game writes it (`write_life` clamps to 1), so he is left at a quarter heart; `actors.damage` refuses Link. Writing 0 directly would skip the heart protection and the times the game takes no hit (some cutscenes), and a mod that subtracts life could kill him by surprise. `player.kill()` makes the deadly hit `actors.damage` already makes (a one-shot internal hit registered with the life component's own damage calculator, as a fall's), on Link's actor and from himself. The game takes it through its own life check: his death plays, then a fairy or the game over, and whatever keeps him from a hit keeps him from this one. - Permission `state.write`, feature `player.kill`. Returns false outside play (a conversation, a cutscene, a menu, a load), with no Link, or with his life at 0. - A hit he does not take (a write not taken within three frames is dropped) is made again every 10 frames, up to 12 hits, until his life is 0; it stops when its mod stops, and logs a warning if he never fell. - The core takes a hit by address only for Link, from himself, while his life is above 0 (`link_can_fall`); every other hit is still by a listed actor that can take one. - `player.set`'s doc now says a life of 0 leaves him at 1, and to use `kill()`; `writes.md`'s open question about a life of 0 is answered. Read first: `player_kill`, `PlayerKill`, `player_kill_next` and `player_kill_step` in `game/crates/api/src/services/actors.rs`; `queue` and `link_can_fall` in `game/crates/game-core/src/actors/writes.rs`; `kill` in `game/modapi/schema/player.toml`. Open question: the mods' damage rules (`rules.damageTaken`) apply to this hit as to any hit, so a rule capping the damage would turn a kill into a smaller hit. Should `kill()` pass them by? ## Testing **Tested:** Windows 10 Home 22H2, AMD Radeon (RDNA3), driver 26.11.2. A mod (made with [Ocarina Forge's](https://github.com/glinesbdev/ocarina-forge) blocks) calls `player.kill()` when a game flag turns on, in play in Kokiri Forest (child) with a bottled fairy: Link fell with his own death animation and the fairy revived him, as from any defeat. With no fairy, he fell and the game over screen followed. With the Cheats mod's heart protection on, he took no damage (he flashed red, as from a blocked hit) and lived, and the log said `player.kill: Link did not fall after 12 hits (the game took none)`. Called directly from a conversation that sets the flag (`` log.info(`player.kill() returned ${player.kill()}`) ``), it returned false four times and Link was unharmed, during the conversation and after it. Checks: `cargo test -p api -p game-core --lib` (one new test, `a_kill_is_hit_again_every_ten_frames_until_link_falls_and_waits_outside_play`), `clippy -D warnings`, `rustfmt`, `schema-gen --check`. `watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree` fails, and fails on `main` too; `fixes::barrier::tests::an_or_and_its_wake_end_a_wait_on_another_thread` failed once and passed three times alone. `mise run test` not run in full. **Still to test:** None. ## Measurements Nothing to measure: one API call; with no kill pending, the per-frame step returns at once. ## Risks A mod with `state.write` can now defeat Link, as the game's own hit would, and only in play; the heart protection still keeps him. A revert is enough; nothing changes for players or saves. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). — not run in full; the api and game-core tests are, with the failures named above. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible.
feat(mod-api): player.kill() defeats Link through the game's own hit
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
390b4a9cd8
A mod had no way to defeat Link. player.set({ life: 0 }) is taken, but
his life is written as the game writes it, which keeps him at 1 and
leaves a defeat to the game's own hit; actors.damage refuses Link.
Writing 0 directly would skip the heart protection and the times the
game takes no hit (some cutscenes), and a mod that subtracts life could
kill him by surprise.

player.kill() makes the deadly hit actors.damage makes (a one-shot
internal hit through the life component's own damage, as a fall's), on
Link's actor, from himself. The game takes it through its life check:
his death plays, then a fairy or the game over, and whatever keeps him
from a hit keeps him from this one. It needs state.write and returns
false outside play, with no Link, or with his life at 0. A hit he does
not take (a write not taken in three frames is dropped) is made again
every 10 frames, up to 12 hits, until his life is 0; it stops when its
mod stops.

The core takes a hit by address only for Link, from himself, while his
life is above 0; every other hit is still by a listed actor that can
take one. player.set's doc now says a life of 0 leaves him at 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Windows 10 Home 22H2, AMD Radeon (RDNA3), driver 26.11.2, child Link in Kokiri Forest: player.kill() from a flag rule made Link fall with his own death animation; a bottled fairy revived him, and with no fairy the game over screen followed. With the Cheats mod's heart protection on he took no damage and lived (the log: Link did not fall after 12 hits). Called from a conversation it returned false and did nothing.

Tested in game: Windows 10 Home 22H2, AMD Radeon (RDNA3), driver 26.11.2, child Link in Kokiri Forest: player.kill() from a flag rule made Link fall with his own death animation; a bottled fairy revived him, and with no fairy the game over screen followed. With the Cheats mod's heart protection on he took no damage and lived (the log: Link did not fall after 12 hits). Called from a conversation it returned false and did nothing.
Member

Possibly related, for context:

  • PR #2175 WIP: feat(modapi): apply scripted actor damage through native life processing — Earlier API work on applying scripted damage through native life processing
Possibly related, for context: - PR #2175 WIP: feat(modapi): apply scripted actor damage through native life processing — Earlier API work on applying scripted damage through native life processing
Owner
@review
HumanBean changed title from WIP: feat(mod-api): player.kill() defeats Link through the game's own hit to feat(mod-api): player.kill() defeats Link through the game's own hit 2026-12-04 01:07:53 +00:00
BeanBot requested changes 2026-12-04 01:08:47 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The hit can outlive its mod, and pending requests can be lost or incorrectly shared between mods. The feature also reports itself available on builds where its write site is absent.

Adds a state.write API for defeating Link through the game's damage path, with retries and documentation. The in-game run demonstrates the intended death, fairy, protection, and conversation cases, but the retry and lifetime handling need changes.

Blocking (4): must change before merging.

  1. L1 game/crates/api/src/services/actors.rs:603: Stopping a mod clears the service's request but does not cancel a hit already published to the core write queue. (more on the line) Do: Track and cancel the owner's outstanding kill ticket when the mod stops, including safe handling of a ticket already in flight.
  2. L2 game/crates/api/src/services/actors.rs:578: A pending kill is discarded when Link stops updating during a pause, rather than waiting for play to resume. (more on the line) Do: Preserve the request while outside play without treating the temporary absence of an updated actor as a completed request; explicitly handle a real session or player replacement.
  3. L3 game/crates/api/src/services/actors.rs:365: A second mod's kill call reports success but is attached to the first mod's request and lifetime. (more on the line) Do: Track each accepted caller's request independently, or explicitly refuse a concurrent request instead of returning success for it.
  4. L4 game/crates/api/src/services/features.rs:188: Feature detection does not require the actor write hook that actually delivers the hit. (more on the line) Do: Include player.kill in the actors.write site requirements and test feature detection with that site absent.

Should fix (1): not blocking, but worth doing before merging.

  • L5 game/crates/api/src/services/actors.rs:585: Retries bypass the write queue's capacity checks and count as hits even when the core cannot queue them. (more on the line) Do: Reserve capacity for retries or check the core's accepted result and advance the hit count only when a retry is queued.

Nits (1): optional.

  • L6 docs/modding/writes.md:212: The documentation still lists the kill behavior as untested in game even though the PR reports that exact run. (more on the line) Do: Move the confirmed behavior out of the untested list and retain only cases that still need testing.

@fix can do L1, L2, L3, L4, L5 and L6.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • Should damageTaken rules be allowed to turn kill into repeated smaller hits? The PR identifies this as an open design choice.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: the author reports that Link fell and either a fairy revived him or game over followed, while heart protection blocked the hit. This is a feature rather than a performance change; no before-and-after performance numbers were supplied.

Other systems: The change uses the shared actor write queue, game-mode and player-presence tracking, damage rules, mod permissions, and feature detection. The reported game run covers Windows on AMD; the lifecycle and missing-site cases are not covered by that run.

Switches: None.

Reviewed: 390b4a9cd8 against 309af878f1: Read the repository rules, PR template, standards, commit and diff, changed schema and core write path, and the surrounding service, frame, player-presence and feature-detection paths. Skimmed the generated documentation and existing tests; the larger changed service files and all generated output were not read in full. Tooling's adjacent AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance with a Co-Authored-By trailer.
  • The changed files contain no game-derived output, third-party changes, renderer API changes, or new switches.
  • The reported game run covers a fairy, game over, heart protection, and a call during conversation.

Testing: No code or tests were run during review. The author reports targeted Rust checks and an in-game Windows run; the full mise test suite was not run and CI is still running.

Overlaps and merge order: Not checked; network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The hit can outlive its mod, and pending requests can be lost or incorrectly shared between mods. The feature also reports itself available on builds where its write site is absent. Adds a state.write API for defeating Link through the game's damage path, with retries and documentation. The in-game run demonstrates the intended death, fairy, protection, and conversation cases, but the retry and lifetime handling need changes. **Blocking (4)**: must change before merging. 1. **L1** `game/crates/api/src/services/actors.rs:603`: Stopping a mod clears the service's request but does not cancel a hit already published to the core write queue. (more on the line) **Do:** Track and cancel the owner's outstanding kill ticket when the mod stops, including safe handling of a ticket already in flight. 2. **L2** `game/crates/api/src/services/actors.rs:578`: A pending kill is discarded when Link stops updating during a pause, rather than waiting for play to resume. (more on the line) **Do:** Preserve the request while outside play without treating the temporary absence of an updated actor as a completed request; explicitly handle a real session or player replacement. 3. **L3** `game/crates/api/src/services/actors.rs:365`: A second mod's kill call reports success but is attached to the first mod's request and lifetime. (more on the line) **Do:** Track each accepted caller's request independently, or explicitly refuse a concurrent request instead of returning success for it. 4. **L4** `game/crates/api/src/services/features.rs:188`: Feature detection does not require the actor write hook that actually delivers the hit. (more on the line) **Do:** Include player.kill in the actors.write site requirements and test feature detection with that site absent. **Should fix (1)**: not blocking, but worth doing before merging. - **L5** `game/crates/api/src/services/actors.rs:585`: Retries bypass the write queue's capacity checks and count as hits even when the core cannot queue them. (more on the line) **Do:** Reserve capacity for retries or check the core's accepted result and advance the hit count only when a retry is queued. **Nits (1)**: optional. - **L6** `docs/modding/writes.md:212`: The documentation still lists the kill behavior as untested in game even though the PR reports that exact run. (more on the line) **Do:** Move the confirmed behavior out of the untested list and retain only cases that still need testing. `@fix` can do L1, L2, L3, L4, L5 and L6. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - Should damageTaken rules be allowed to turn kill into repeated smaller hits? The PR identifies this as an open design choice. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the author reports that Link fell and either a fairy revived him or game over followed, while heart protection blocked the hit. This is a feature rather than a performance change; no before-and-after performance numbers were supplied. **Other systems:** The change uses the shared actor write queue, game-mode and player-presence tracking, damage rules, mod permissions, and feature detection. The reported game run covers Windows on AMD; the lifecycle and missing-site cases are not covered by that run. **Switches:** None. **Reviewed:** 390b4a9cd8f3 against 309af878f162: Read the repository rules, PR template, standards, commit and diff, changed schema and core write path, and the surrounding service, frame, player-presence and feature-detection paths. Skimmed the generated documentation and existing tests; the larger changed service files and all generated output were not read in full. Tooling's adjacent AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance with a Co-Authored-By trailer. - The changed files contain no game-derived output, third-party changes, renderer API changes, or new switches. - The reported game run covers a fairy, game over, heart protection, and a call during conversation. **Testing:** No code or tests were run during review. The author reports targeted Rust checks and an in-game Windows run; the full mise test suite was not run and CI is still running. **Overlaps and merge order:** Not checked; network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -210,3 +210,3 @@
written in place reaches the save at once or at the game's own next change of it is not yet known);
- the HUD follows a life or rupee write (the hearts and the rupee count redraw);
- `player.set({ life: 0 })`: whether Link falls at once or at the next hit;
- `player.kill()`: that Link falls at once, his death plays and a fairy or the game over follows (`player.set({ life: 0 })` leaves him at 1: his life is written as the game writes it, leaving a defeat to the game's own hit, which `kill()` makes);
Member

L6 (nit): The documentation still lists the kill behavior as untested in game even though the PR reports that exact run.

When: A modder reading the list is told the death, fairy and game-over behavior still needs a game run, despite the recorded successful run.

Do: Move the confirmed behavior out of the untested list and retain only cases that still need testing.

**L6** (nit): The documentation still lists the kill behavior as untested in game even though the PR reports that exact run. *When:* A modder reading the list is told the death, fairy and game-over behavior still needs a game run, despite the recorded successful run. **Do:** Move the confirmed behavior out of the untested list and retain only cases that still need testing.
@ -310,0 +362,4 @@
{
return Ok(false);
}
if self.actors.borrow().pending_kill.is_some() {
Member

L3 (blocking): A second mod's kill call reports success but is attached to the first mod's request and lifetime.

When: Mod A has a pending blocked kill and mod B calls kill; B receives true without its own hit or ownership. If A stops, actors_gone clears the request, so B's accepted call never takes effect.

Do: Track each accepted caller's request independently, or explicitly refuse a concurrent request instead of returning success for it.

**L3** (blocking): A second mod's kill call reports success but is attached to the first mod's request and lifetime. *When:* Mod A has a pending blocked kill and mod B calls kill; B receives true without its own hit or ownership. If A stops, actors_gone clears the request, so B's accepted call never takes effect. **Do:** Track each accepted caller's request independently, or explicitly refuse a concurrent request instead of returning success for it.
@ -503,3 +600,4 @@
/// A stopped mod's queued writes and lights dropped.
pub(crate) fn actors_gone(&self, id: &ModId) {
let mut s = self.actors.borrow_mut();
Member

L1 (blocking): Stopping a mod clears the service's request but does not cancel a hit already published to the core write queue.

When: A mod calls kill, its hit is handed to game_core::actors::writes, and the mod stops before Link's update takes it. actors_gone removes only service-queued writes and pending_kill; the published ticket can still be taken during the following frames and defeat Link after the mod stopped.

Do: Track and cancel the owner's outstanding kill ticket when the mod stops, including safe handling of a ticket already in flight.

**L1** (blocking): Stopping a mod clears the service's request but does not cancel a hit already published to the core write queue. *When:* A mod calls kill, its hit is handed to game_core::actors::writes, and the mod stops before Link's update takes it. actors_gone removes only service-queued writes and pending_kill; the published ticket can still be taken during the following frames and defeat Link after the mod stopped. **Do:** Track and cancel the owner's outstanding kill ticket when the mod stops, including safe handling of a ticket already in flight.
@ -503,0 +575,4 @@
self.actors.get_mut().pending_kill = None;
return;
}
let link = game_core::player::actor();
Member

L2 (blocking): A pending kill is discarded when Link stops updating during a pause, rather than waiting for play to resume.

When: After a blocked hit, the player opens a pause menu for more than the player-presence timeout. player::actor returns None, so player_kill_next ends the request even though the code intends to wait outside play; no further hit is made on returning to play.

Do: Preserve the request while outside play without treating the temporary absence of an updated actor as a completed request; explicitly handle a real session or player replacement.

**L2** (blocking): A pending kill is discarded when Link stops updating during a pause, rather than waiting for play to resume. *When:* After a blocked hit, the player opens a pause menu for more than the player-presence timeout. player::actor returns None, so player_kill_next ends the request even though the code intends to wait outside play; no further hit is made on returning to play. **Do:** Preserve the request while outside play without treating the temporary absence of an updated actor as a completed request; explicitly handle a real session or player replacement.
@ -503,0 +582,4 @@
let Some(k) = s.pending_kill.as_mut() else { return };
match player_kill_next(life, play, k) {
Some(true) => {
if let Some(link) = link {
Member

L5 (should fix): Retries bypass the write queue's capacity checks and count as hits even when the core cannot queue them.

When: If other mods fill the core's pending write table when a retry is due, the retry is appended directly and game_core::actors::writes silently rejects it, while hits has already advanced. Repeated contention can exhaust all retries without delivering them.

Do: Reserve capacity for retries or check the core's accepted result and advance the hit count only when a retry is queued.

**L5** (should fix): Retries bypass the write queue's capacity checks and count as hits even when the core cannot queue them. *When:* If other mods fill the core's pending write table when a retry is due, the retry is appended directly and game_core::actors::writes silently rejects it, while hits has already advanced. Repeated contention can exhaust all retries without delivering them. **Do:** Reserve capacity for retries or check the core's accepted result and advance the hit count only when a retry is queued.
@ -185,2 +185,4 @@
"player.state.velocity" => player_has(game_core::player::field::VEL),
"player.state.life" => player_has(game_core::player::field::LIFE),
// (Link's defeat is the hit actors.damage makes, on his own actor)
"player.kill" => actors_have(Actors::DAMAGE | Actors::LIFE),
Member

L4 (blocking): Feature detection does not require the actor write hook that actually delivers the hit.

When: On a build with the damage and life locations resolved but no placed actors.write site, has('player.kill') returns true and calls can return true, yet no actor update takes the queued hit.

Do: Include player.kill in the actors.write site requirements and test feature detection with that site absent.

**L4** (blocking): Feature detection does not require the actor write hook that actually delivers the hit. *When:* On a build with the damage and life locations resolved but no placed actors.write site, has('player.kill') returns true and calls can return true, yet no actor update takes the queued hit. **Do:** Include player.kill in the actors.write site requirements and test feature detection with that site absent.
fix(mod-api): player.kill per mod, waits while Link is hidden, takes back a stopped mod's hits
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
4bdf95bef8
The review of #3143:
- L1: a stopped mod's kill hits still waiting in the core's table are
  taken back (WriteQueue::cancel_hits, a compare-and-swap to dropped); a
  hit a game thread holds is left to its update.
- L2: a pending kill waits while the game shows no Link (a pause, a
  menu), and ends only when he falls, another Link replaces him (a new
  session or map), the game goes back to the title, or the hits run out.
- L3: each mod has its own pending kill; a second mod's call queues its
  own hit and lives with its own mod.
- L4: player.kill needs the actors.write site, as actors.damage does.
- L5: a repeat hit is queued only with room in the core's table and
  counted only when queued; without room it is tried the next frame.
- L6: writes.md no longer lists the kill as untested in a game.

kill() is declared to throw LimitError, as actors.damage does, when the
table of writes is full at the call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Thanks for the review. All six are addressed in 4bdf95bef:

L1 (a stopped mod's hit can still land): when a mod with a pending kill stops, its hits still waiting for Link in the core's write table are taken back at the next write step (WriteQueue::cancel_hits: a compare-and-swap from waiting to dropped, so a site that loads its table late cannot take one after). A hit a game thread already holds is in Link's update and is left to it; that window is the update itself. Test: a_hit_waiting_for_its_actor_is_taken_back_but_not_one_being_made (one not armed yet, one waiting, one held, and a non-hit write to the same actor that stays).

L2 (a pause ends the kill): the pending kill now remembers Link's actor. While the game shows no Link (a pause, a menu) or his life cannot be read, it waits, however long; it ends only when he falls, another Link replaces him (a new session or map), the game goes back to the title, or the hits run out. Test: a_kill_is_hit_again_every_ten_frames_until_link_falls_and_waits_while_he_is_hidden.

L3 (a second mod's call shares the first's request): each mod has its own pending kill. A second mod's kill() queues its own hit and lives and ends with its own mod; a call while the same mod's kill is pending still answers true and adds nothing. Stopping one mod takes back the waiting hits on Link, and any other mod's pending kill queues its own again at its next hit.

L4 (has("player.kill") without the write site): player.kill now needs the actors.write site, as actors.damage does; a_member_whose_sites_are_not_placed_is_absent checks it is absent without that site.

L5 (retries skip the capacity check): a repeat hit is queued only when the core's table has room, and counted only when queued; without room it is tried the next frame. kill() itself is now declared to throw LimitError when the table is full at the call, as actors.damage does.

L6: writes.md no longer lists the kill as untested in a game; the schema doc says what a run showed.
On the question: the mods' damage rules still apply to the hit, as to any hit. If kill() should pass them by, I'd rather mark the hit at the damage site than skip the rules for every hit by address; happy to do that if you want it.

For context, #2175 is where actors.damage's native hit came from, and it deliberately refused Link. This PR keeps that refusal for actors.damage and adds Link's defeat as its own call on the same hit, aimed only at him, from himself, while he is alive.

Checks on 4bdf95bef: cargo test -p api -p game-core --lib (the one failure, watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree, also fails on main), clippy -D warnings, rustfmt --check, schema-gen --check. In game on this head (same PC as the description): kill() called during a conversation returned false; once it ended Link fell and a bottled fairy revived him; with heart protection on, the log said he did not fall after 12 hits. Paused mid-kill with heart protection on: three hits were blocked, then none for the 10+ seconds of the pause, then the rest after unpausing, and the log said he did not fall after 12 hits. Paused mid-kill again and turned heart protection off in the menu: on unpausing, the next hit took him and he died. A mod stopping mid-kill (L1) is covered by the unit test, not by a game run.

Thanks for the review. All six are addressed in 4bdf95bef: L1 (a stopped mod's hit can still land): when a mod with a pending kill stops, its hits still waiting for Link in the core's write table are taken back at the next write step (WriteQueue::cancel_hits: a compare-and-swap from waiting to dropped, so a site that loads its table late cannot take one after). A hit a game thread already holds is in Link's update and is left to it; that window is the update itself. Test: a_hit_waiting_for_its_actor_is_taken_back_but_not_one_being_made (one not armed yet, one waiting, one held, and a non-hit write to the same actor that stays). L2 (a pause ends the kill): the pending kill now remembers Link's actor. While the game shows no Link (a pause, a menu) or his life cannot be read, it waits, however long; it ends only when he falls, another Link replaces him (a new session or map), the game goes back to the title, or the hits run out. Test: a_kill_is_hit_again_every_ten_frames_until_link_falls_and_waits_while_he_is_hidden. L3 (a second mod's call shares the first's request): each mod has its own pending kill. A second mod's kill() queues its own hit and lives and ends with its own mod; a call while the same mod's kill is pending still answers true and adds nothing. Stopping one mod takes back the waiting hits on Link, and any other mod's pending kill queues its own again at its next hit. L4 (has("player.kill") without the write site): player.kill now needs the actors.write site, as actors.damage does; a_member_whose_sites_are_not_placed_is_absent checks it is absent without that site. L5 (retries skip the capacity check): a repeat hit is queued only when the core's table has room, and counted only when queued; without room it is tried the next frame. kill() itself is now declared to throw LimitError when the table is full at the call, as actors.damage does. L6: writes.md no longer lists the kill as untested in a game; the schema doc says what a run showed. On the question: the mods' damage rules still apply to the hit, as to any hit. If kill() should pass them by, I'd rather mark the hit at the damage site than skip the rules for every hit by address; happy to do that if you want it. For context, #2175 is where actors.damage's native hit came from, and it deliberately refused Link. This PR keeps that refusal for actors.damage and adds Link's defeat as its own call on the same hit, aimed only at him, from himself, while he is alive. Checks on 4bdf95bef: cargo test -p api -p game-core --lib (the one failure, watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree, also fails on main), clippy -D warnings, rustfmt --check, schema-gen --check. In game on this head (same PC as the description): kill() called during a conversation returned false; once it ended Link fell and a bottled fairy revived him; with heart protection on, the log said he did not fall after 12 hits. Paused mid-kill with heart protection on: three hits were blocked, then none for the 10+ seconds of the pause, then the rest after unpausing, and the log said he did not fall after 12 hits. Paused mid-kill again and turned heart protection off in the menu: on unpausing, the next hit took him and he died. A mod stopping mid-kill (L1) is covered by the unit test, not by a game run.
Member
@review
BeanBot left a comment

Recommendation: Request changes. A stopped mod’s published hit can survive if Link is hidden when cancellation runs. Stopping one mod can also cancel another mod’s final pending hit.

Adds player.kill() so mods can defeat Link through the game’s damage and death handling. The per-mod retry and cancellation machinery supports that feature but still has ownership and lifetime gaps.

Blocking (1): must change before merging.

  1. L1 game/crates/api/src/services/actors.rs:603: Stopping one mod cancels every waiting hit on Link, including another mod’s hit. When: If another mod has just queued its twelfth hit and the first mod stops before that hit is taken, cancel_hits drops both mods’ hits. The surviving request has already counted its final hit, so it later ends without replacing it. Do: Track ownership or a cancellation token through the core queue and cancel only the stopped mod’s hits.

@fix can do L1.

Since the last review (on 390b4a9cd8)
Resolved: L2 (A pending kill is discarded when Link stops updating during a pause, rather than waiting f…); L3 (A second mod's kill call reports success but is attached to the first mod's request and li…); L4 (Feature detection does not require the actor write hook that actually delivers the hit.); L5 (Retries bypass the write queue's capacity checks and count as hits even when the core cann…); L6 (The documentation still lists the kill behavior as untested in game even though the PR rep…)
Still open: L1 (Stopping one mod cancels every waiting hit on Link, including another mod’s hit.)

Checks: Still running: 11 checks.

Also noticed (1; not asked for, not blocking)
  • The full mise test suite has not been reported as run, and the supplied CI checks are still running.
More: does it help, other systems, switches, what was read

Does it help: Yes: the author reports death, fairy revival, game over and heart protection working in game on Windows with an AMD RDNA3 GPU. This is not a performance change.

Other systems: The hit uses the existing actor write and damage path, including damage rules and heart protection. The reported game run covers Windows and AMD; the changes are not GPU-specific.

Switches: None.

Reviewed: 4bdf95bef8 against 309af878f1: Read AGENTS.md, CONTRIBUTING.md, the applicable standards, the PR diff and fix diff, and the relevant actor service, write queue, feature detection and schema sections. Skimmed generated documentation and tests; did not read every changed code file in full. The sibling Tooling checkout was unavailable.; nothing run (a code review).

Checked and fine:

  • The core cancellation uses a ticket compare-and-swap for a published waiting hit and leaves a hit already held by a game thread alone.
  • The retry capacity check counts hits only after adding them to the service queue.
  • The author reports testing the updated pause behavior in game.

Testing: No commands that build or run project code were executed. The author reports API and game-core tests, lint and schema checks, plus game runs; the supplied CI is still running.

Overlaps and merge order: None found in the supplied material.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** A stopped mod’s published hit can survive if Link is hidden when cancellation runs. Stopping one mod can also cancel another mod’s final pending hit. Adds player.kill() so mods can defeat Link through the game’s damage and death handling. The per-mod retry and cancellation machinery supports that feature but still has ownership and lifetime gaps. **Blocking (1)**: must change before merging. 1. **L1** `game/crates/api/src/services/actors.rs:603`: Stopping one mod cancels every waiting hit on Link, including another mod’s hit. *When:* If another mod has just queued its twelfth hit and the first mod stops before that hit is taken, cancel_hits drops both mods’ hits. The surviving request has already counted its final hit, so it later ends without replacing it. **Do:** Track ownership or a cancellation token through the core queue and cancel only the stopped mod’s hits. `@fix` can do L1. **Since the last review** (on 390b4a9cd8f3) Resolved: L2 (A pending kill is discarded when Link stops updating during a pause, rather than waiting f…); L3 (A second mod's kill call reports success but is attached to the first mod's request and li…); L4 (Feature detection does not require the actor write hook that actually delivers the hit.); L5 (Retries bypass the write queue's capacity checks and count as hits even when the core cann…); L6 (The documentation still lists the kill behavior as untested in game even though the PR rep…) Still open: L1 (Stopping one mod cancels every waiting hit on Link, including another mod’s hit.) **Checks:** Still running: 11 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The full mise test suite has not been reported as run, and the supplied CI checks are still running. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the author reports death, fairy revival, game over and heart protection working in game on Windows with an AMD RDNA3 GPU. This is not a performance change. **Other systems:** The hit uses the existing actor write and damage path, including damage rules and heart protection. The reported game run covers Windows and AMD; the changes are not GPU-specific. **Switches:** None. **Reviewed:** 4bdf95bef88a against 309af878f162: Read AGENTS.md, CONTRIBUTING.md, the applicable standards, the PR diff and fix diff, and the relevant actor service, write queue, feature detection and schema sections. Skimmed generated documentation and tests; did not read every changed code file in full. The sibling Tooling checkout was unavailable.; nothing run (a code review). **Checked and fine:** - The core cancellation uses a ticket compare-and-swap for a published waiting hit and leaves a hit already held by a game thread alone. - The retry capacity check counts hits only after adding them to the service queue. - The author reports testing the updated pause behavior in game. **Testing:** No commands that build or run project code were executed. The author reports API and game-core tests, lint and schema checks, plus game runs; the supplied CI is still running. **Overlaps and merge order:** None found in the supplied material. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Each pending kill tags its hits in the core's write table; when its mod
stops, only that tag's waiting hits are taken back, whether or not Link
is shown at the time. Another mod's hits on Link stay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(mod-api): refuse a stopped mod's player.kill hit the game still holds
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
1e2abfdd84
A hit the actors.write site made is registered with Link's life
component and applied by the life apply later; a pause between the two
holds it, so a mod stopped while paused still had its hit land after
the pause. When a mod stops and its newest made hit is still held (the
internal damage calculator's hit word still holds its amount, read
only), that hit is refused at player.lifeHit by its life component and
amount, as heart protection refuses a hit, once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

L1 is addressed in a56b045dd. Each pending kill now has its own tag, carried by its hits into the core's write table (ActorWrite::tag, kept main-thread-side in the pending slot, so the C WriteEntry is unchanged). When a mod stops, actors_gone records only that mod's tags, and the next step takes back only the waiting hits with those tags (WriteQueue::cancel_hits(tag)).

Another mod's hit stays: its tag is different, so its twelfth hit is not dropped by another mod stopping, and its count stays right.
Link hidden at cancellation: the cancellation no longer looks up Link's actor. It goes by the tag, so a pause or menu at that moment doesn't let the stopped mod's hit survive.

A hit the game already holds (1e2abfdd8): testing in a game showed the window was wider than the update. The site registers the hit with Link's life component, and the life apply makes it later; a pause between the two holds it, so a mod stopped while paused still had its hit land on unpausing. When a mod stops and its newest made hit is still held (the internal damage calculator's hit word still holds its amount; read only), that hit is refused once at player.lifeHit, by its life component and amount, as heart protection refuses a hit. Clearing that word instead did not work: the life apply takes the hit from elsewhere. Test: a_hit_made_and_not_applied_yet_is_refused_when_applied_by_its_tag.

A hit a game thread is making right now (taken, mid-update) is still left to that update.
Tests: a_hit_waiting_is_taken_back_by_its_tag_only_but_not_one_being_made (the tag's unarmed, waiting and held hits; another tag's hit on the same actor; an untagged hit; a non-hit write) and a_stopped_mods_kill_is_dropped_and_only_its_tag_taken_back (two mods' kills; stopping one leaves the other pending and cancels only the first's tag).

Checks on 1e2abfdd8: cargo test -p api -p game-core --lib (only watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree fails, as on main), clippy -D warnings, rustfmt --check, schema-gen --check (on a56b045dd; the schema is unchanged since). In a game, with a second test mod calling kill() and heart protection on: on a56b045dd, one mod stopped mid-kill and the other mod's kill went on and took Link. On 1e2abfdd8, with only the test mod, paused mid-kill, switched it off in the Mods tab, turned heart protection off and unpaused: the held hit was refused (Link flashed once, as from a blocked hit) and he lived.

L1 is addressed in a56b045dd. Each pending kill now has its own tag, carried by its hits into the core's write table (ActorWrite::tag, kept main-thread-side in the pending slot, so the C WriteEntry is unchanged). When a mod stops, actors_gone records only that mod's tags, and the next step takes back only the waiting hits with those tags (WriteQueue::cancel_hits(tag)). Another mod's hit stays: its tag is different, so its twelfth hit is not dropped by another mod stopping, and its count stays right. Link hidden at cancellation: the cancellation no longer looks up Link's actor. It goes by the tag, so a pause or menu at that moment doesn't let the stopped mod's hit survive. A hit the game already holds (1e2abfdd8): testing in a game showed the window was wider than the update. The site registers the hit with Link's life component, and the life apply makes it later; a pause between the two holds it, so a mod stopped while paused still had its hit land on unpausing. When a mod stops and its newest made hit is still held (the internal damage calculator's hit word still holds its amount; read only), that hit is refused once at player.lifeHit, by its life component and amount, as heart protection refuses a hit. Clearing that word instead did not work: the life apply takes the hit from elsewhere. Test: a_hit_made_and_not_applied_yet_is_refused_when_applied_by_its_tag. A hit a game thread is making right now (taken, mid-update) is still left to that update. Tests: a_hit_waiting_is_taken_back_by_its_tag_only_but_not_one_being_made (the tag's unarmed, waiting and held hits; another tag's hit on the same actor; an untagged hit; a non-hit write) and a_stopped_mods_kill_is_dropped_and_only_its_tag_taken_back (two mods' kills; stopping one leaves the other pending and cancels only the first's tag). Checks on 1e2abfdd8: cargo test -p api -p game-core --lib (only watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree fails, as on main), clippy -D warnings, rustfmt --check, schema-gen --check (on a56b045dd; the schema is unchanged since). In a game, with a second test mod calling kill() and heart protection on: on a56b045dd, one mod stopped mid-kill and the other mod's kill went on and took Link. On 1e2abfdd8, with only the test mod, paused mid-kill, switched it off in the Mods tab, turned heart protection off and unpaused: the held hit was refused (Link flashed once, as from a blocked hit) and he lived.
Member
@review
BeanBot left a comment

Recommendation: Request changes. Tagged cancellation now leaves other mods’ waiting hits alone, including while Link is hidden. The new held-hit cancellation passes the actor address where it must pass the life-component address, so a stopped mod’s held hit can still defeat Link.

The PR gives mods a way to defeat Link through the game’s damage path, preserving normal death and fairy behavior. Per-mod tags improve cancellation isolation, but the added held-hit refusal does not match the value it records.

Blocking (2): must change before merging.

  1. L7 game/crates/game-core/src/heart_protection.rs:53: The held-hit check passes Link’s actor address to a function that compares it with the recorded life-component address. (more on the line) Do: Resolve the actor’s life-component address and pass that address to refuse_held_hit; add a test through held_hit_refused using distinct actor and component addresses.
  2. L8: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

@fix can do L7.

Since the last review (on 4bdf95bef8)
Resolved: L1 (Stopping one mod cancels every waiting hit on Link, including another mod’s hit.)
New: L7 (The held-hit check passes Link’s actor address to a function that compares it with the rec…); L8 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)

Checks: Still running: 11 checks.

Also noticed (1; not asked for, not blocking)
  • If two mods’ hits are made in the same update, cancellation deliberately leaves the held hit when its owner cannot be identified.
More: does it help, other systems, switches, what was read

Does it help: Yes. The author reports that on Windows, Link died or was revived by a fairy as expected, and heart protection blocked the hit. The held-hit cancellation has a correctness defect despite the reported in-game result.

Other systems: The change touches Link’s life-hit hook and mod damage rules on both Windows and Linux. The reported game runs were on Windows; the refusal defect follows from the shared register and address handling.

Switches: None.

Reviewed: 1e2abfdd84 against 309af878f1: Read AGENTS.md, CONTRIBUTING.md, the commits and the changes since 4bdf95bef, and the cancellation, life-hit and player.kill paths. Skimmed the rest of the PR diff and generated modding reference; the remaining changed code files were not read in full. No review checklist or pull request template was found.; nothing run (a code review).

Checked and fine:

  • Waiting hits are cancelled by their own tags even when Link is hidden.
  • The feature declaration requires the actors.write site.
  • The author reports in-game checks for death, fairy revival, heart protection and calls during conversation.

Testing: No code or tests were run. The author reports API and game-core tests, lint checks and Windows game runs; CI checks are still running.

Overlaps and merge order: Not established from the available information.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Tagged cancellation now leaves other mods’ waiting hits alone, including while Link is hidden. The new held-hit cancellation passes the actor address where it must pass the life-component address, so a stopped mod’s held hit can still defeat Link. The PR gives mods a way to defeat Link through the game’s damage path, preserving normal death and fairy behavior. Per-mod tags improve cancellation isolation, but the added held-hit refusal does not match the value it records. **Blocking (2)**: must change before merging. 1. **L7** `game/crates/game-core/src/heart_protection.rs:53`: The held-hit check passes Link’s actor address to a function that compares it with the recorded life-component address. (more on the line) **Do:** Resolve the actor’s life-component address and pass that address to refuse_held_hit; add a test through held_hit_refused using distinct actor and component addresses. 2. **L8**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* `@fix` can do L7. **Since the last review** (on 4bdf95bef88a) Resolved: L1 (Stopping one mod cancels every waiting hit on Link, including another mod’s hit.) New: L7 (The held-hit check passes Link’s actor address to a function that compares it with the rec…); L8 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) **Checks:** Still running: 11 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - If two mods’ hits are made in the same update, cancellation deliberately leaves the held hit when its owner cannot be identified. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that on Windows, Link died or was revived by a fairy as expected, and heart protection blocked the hit. The held-hit cancellation has a correctness defect despite the reported in-game result. **Other systems:** The change touches Link’s life-hit hook and mod damage rules on both Windows and Linux. The reported game runs were on Windows; the refusal defect follows from the shared register and address handling. **Switches:** None. **Reviewed:** 1e2abfdd8494 against 309af878f162: Read AGENTS.md, CONTRIBUTING.md, the commits and the changes since 4bdf95bef, and the cancellation, life-hit and player.kill paths. Skimmed the rest of the PR diff and generated modding reference; the remaining changed code files were not read in full. No review checklist or pull request template was found.; nothing run (a code review). **Checked and fine:** - Waiting hits are cancelled by their own tags even when Link is hidden. - The feature declaration requires the actors.write site. - The author reports in-game checks for death, fairy revival, heart protection and calls during conversation. **Testing:** No code or tests were run. The author reports API and game-core tests, lint checks and Windows game runs; CI checks are still running. **Overlaps and merge order:** Not established from the available information. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -40,0 +50,4 @@
if g.x(layout::FIELD_REG) != field.wrapping_add(layout::LIFE_VALUE_AT) {
return false;
}
if !crate::actors::refuse_held_hit(life, g.w(layout::HIT_REG)) {
Member

L7 (blocking): The held-hit check passes Link’s actor address to a function that compares it with the recorded life-component address.

When: When a mod is stopped after its kill hit is registered but before it is applied, unregister_hit stores e.life in HELD_LIFE. At player.lifeHit, x19 is the actor, so refuse_held_hit receives a different address and the held hit is applied when play resumes.

Do: Resolve the actor’s life-component address and pass that address to refuse_held_hit; add a test through held_hit_refused using distinct actor and component addresses.

**L7** (blocking): The held-hit check passes Link’s actor address to a function that compares it with the recorded life-component address. *When:* When a mod is stopped after its kill hit is registered but before it is applied, unregister_hit stores e.life in HELD_LIFE. At player.lifeHit, x19 is the actor, so refuse_held_hit receives a different address and the held hit is applied when play resumes. **Do:** Resolve the actor’s life-component address and pass that address to refuse_held_hit; add a test through held_hit_refused using distinct actor and component addresses.
glinesbdev force-pushed feat/mod-api-player-kill from 1e2abfdd84
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 89d4f8130b
Some checks failed
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Failing after 5s
2026-12-04 04:15:27 +00:00
Compare
Author
Contributor

L7: x19 at player.lifeHit is Link's life component, not his GameActor. The layout named it "the actor", which was misleading. Everything the site reads through it is a life-component field:

Read at x19 Offset Life component's field
life pointer (ACTOR_LIFE) +0x1c10 layout::actors::LIFE_CURRENT
resource (PLAYER_RESOURCE) +0x10 layout::actors::LIFE_RESOURCE
rules::life also treats the same register as "the life component". The GameActor's own life component sits at its components' +0x2b8. So the address recorded for a held hit (e.life, the component) is the one compared at the site. The game run on df07e28c2 showed the refusal firing: actors: a stopped mod's player.kill hit the game held was refused, then damage: Link's life 64 -> 0 at player.lifeHit, written 64, with heart protection off.

89d4f8130 adds the test you asked for: a_held_hit_is_refused_by_the_life_component_the_site_writes_not_the_actor. It goes through held_hit_refused with the actor and the component at different addresses:

the actor's address is not refused;
another hit amount is left to the game;
the component's address is refused once (his life is kept) and then the refusal is spent.
The register's doc in layout/heart_protection.rs now says it is the life component.

L8: rebased on main (ca830e895). The only conflicts were the three generated docs (docs/modding/permissions.md, reference.md, scripting.md), regenerated with schema-gen on each commit.

Checks on 89d4f8130:

cargo test -p api -p game-core --lib: the only failure is watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree, which also fails on main.
cargo clippy -p game-core -p api --no-deps -D warnings: clean. Without --no-deps it stops on an unused import (note_lines) in builder/crates/build-core/src/sandbox_windows.rs, which comes from main (de8dee94e) and is not touched here.
cargo fmt --all --check and schema-gen --check: clean.

L7: x19 at player.lifeHit is Link's life component, not his GameActor. The layout named it "the actor", which was misleading. Everything the site reads through it is a life-component field: Read at x19 Offset Life component's field life pointer (ACTOR_LIFE) +0x1c10 layout::actors::LIFE_CURRENT resource (PLAYER_RESOURCE) +0x10 layout::actors::LIFE_RESOURCE rules::life also treats the same register as "the life component". The GameActor's own life component sits at its components' +0x2b8. So the address recorded for a held hit (e.life, the component) is the one compared at the site. The game run on df07e28c2 showed the refusal firing: actors: a stopped mod's player.kill hit the game held was refused, then damage: Link's life 64 -> 0 at player.lifeHit, written 64, with heart protection off. 89d4f8130 adds the test you asked for: a_held_hit_is_refused_by_the_life_component_the_site_writes_not_the_actor. It goes through held_hit_refused with the actor and the component at different addresses: the actor's address is not refused; another hit amount is left to the game; the component's address is refused once (his life is kept) and then the refusal is spent. The register's doc in layout/heart_protection.rs now says it is the life component. L8: rebased on main (ca830e895). The only conflicts were the three generated docs (docs/modding/permissions.md, reference.md, scripting.md), regenerated with schema-gen on each commit. Checks on 89d4f8130: cargo test -p api -p game-core --lib: the only failure is watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree, which also fails on main. cargo clippy -p game-core -p api --no-deps -D warnings: clean. Without --no-deps it stops on an unused import (note_lines) in builder/crates/build-core/src/sandbox_windows.rs, which comes from main (de8dee94e) and is not touched here. cargo fmt --all --check and schema-gen --check: clean.
Member
@review
BeanBot left a comment

Recommendation: Approve. The held-hit check uses the life-component address supplied at the hook, and the author reports an in-game cancellation working. The branch is also up to date with its stated base. Recommend approval; not approved on the forge.

Mods can ask the game to defeat Link through its own damage and death handling, while retaining protections and per-mod cancellation. This adds retry and cancellation logic to the actor-write path.

Since the last review (on 1e2abfdd84)
Resolved: L8 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)
Withdrawn (it was wrong): L7 (The held-hit check passes Link’s actor address to a function that compares it with the rec…)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. The author reports that Link died, a fairy revived him when present, heart protection blocked the hit, and a stopped mod's held hit was refused. This is not a performance change.

Other systems: The hit passes through the game's life handling and mod damage rules; heart protection and cancellation were reported tested on Windows with AMD hardware. No Linux game run was reported.

Switches: None.

Reviewed: 89d4f8130b against ca830e8959: Read AGENTS.md, CONTRIBUTING.md, heart_protection.rs and layout/heart_protection.rs in full; inspected the diff, commit list, changed actor exports and held-hit code. Generated documentation and the remaining changed code were skimmed.; nothing run (a code review).

Checked and fine:

  • The held-hit refusal checks the life field and consumes the matching refusal once.
  • The regenerated documentation carries the updated schema hash.

Testing: The author reports game runs and passing focused checks, apart from a test also failing on main. CI is still running. No commands that build or run the project were executed in this review.

Overlaps and merge order: Not checked.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The held-hit check uses the life-component address supplied at the hook, and the author reports an in-game cancellation working. The branch is also up to date with its stated base. Recommend approval; not approved on the forge. Mods can ask the game to defeat Link through its own damage and death handling, while retaining protections and per-mod cancellation. This adds retry and cancellation logic to the actor-write path. **Since the last review** (on 1e2abfdd8494) Resolved: L8 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) Withdrawn (it was wrong): L7 (The held-hit check passes Link’s actor address to a function that compares it with the rec…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that Link died, a fairy revived him when present, heart protection blocked the hit, and a stopped mod's held hit was refused. This is not a performance change. **Other systems:** The hit passes through the game's life handling and mod damage rules; heart protection and cancellation were reported tested on Windows with AMD hardware. No Linux game run was reported. **Switches:** None. **Reviewed:** 89d4f8130b42 against ca830e895926: Read AGENTS.md, CONTRIBUTING.md, heart_protection.rs and layout/heart_protection.rs in full; inspected the diff, commit list, changed actor exports and held-hit code. Generated documentation and the remaining changed code were skimmed.; nothing run (a code review). **Checked and fine:** - The held-hit refusal checks the life field and consumes the matching refusal once. - The regenerated documentation carries the updated schema hash. **Testing:** The author reports game runs and passing focused checks, apart from a test also failing on main. CI is still running. No commands that build or run the project were executed in this review. **Overlaps and merge order:** Not checked. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
llun approved these changes 2026-12-04 04:32:14 +00:00
llun scheduled this pull request to auto merge when all checks succeed 2026-12-04 04:32:18 +00:00
llun requested review from BeanBot 2026-12-04 05:38:58 +00:00
llun merged commit 2603ac215f into main 2026-12-04 05:39:07 +00:00
Some checks failed
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Failing after 5s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3143
No description provided.