fix: animals and heals count toward titles; an event's zone enforces its flags (runicnpc 9d, D320–D322) #28

Merged
whitlocktech merged 2 commits from fix/walk-titles-zones into edge 2026-10-07 13:47:16 -05:00
Member

What & why

The RunicNPC 9d server-side walk (docs PR in this series) found three faults on both rigs. The org lead chose to fix all three ("Fix the animal kill things", the ZoneManager patch, and heals from an example).

  • D320, animal kills (bridge). Rust's animals are now Rust.Ai.Gen2.BaseNPC2: stag, boar, wolf, bears, big cats, crocodile, farm animals, critters and sea life. The bridge tested BaseNpc alone, so an animal kill counted neither in animalKills nor in npcKills. Every BaseNPC2 now counts as an animal, except ScientistNPC2, the one person among them, which counts as a human NPC kill.
  • D321, heals (bridge). OnHealingItemUse is (tool, fromPlayer, toTarget). The two-parameter handler received the healer as the target and dropped every heal as healing yourself, so "Players healed" counted revives only. It now reads the target. A syringe revive raises both hooks, the heal first, so one shared CountHelp counts one act of help once, whichever hook comes first.
  • D322, zone flags (RunicGatewayZones 0.2.0). ZoneManager 3.1.14 subscribes the hooks behind its flags only for the zones it had when it loaded. A zone opened later through its API, which is every event zone, enforced nothing. The helper's existing postfix sees every zone that is created, updated or loaded; it now also has ZoneManager run its own UpdateHookSubscriptions on the next tick, before entering the players already inside. A ZoneManager without that method is warned about and shown by rgz.status.

No message changes shape; protocol stays 13.

How it was tested

  • node scripts/checkPlugin.js: plugin ok, protocol 13, 54 hooks. node --test scripts/checkPlugin.test.js: 14/14.

  • Compiled and loaded on both rigs (Rust 25681086, Oxide 2.0.7801, Carbon 2.0.262).

  • D320 and D321: stand-in players drove Rust's own code: a revolver kill on a stag, a machete kill on a boar, a bandage on another player, and a syringe revive of a downed one. Read back on the walk site, each rig moved by exactly +2 npc_kills, +2 animal_kills and +2 healed. Before the fix, 4 animal kills gave 0 and no bandage counted.

  • D322: each pass started from a reloaded ZoneManager, with an event opening the Arena preset (NoBuild, PvpGod, …):

    PvP inside the zone Build inside the zone
    Without the helper the victim died in 3 hits the foundation still stood
    With 0.2.0 0 damage in 40 hits foundation removed within 3 s

    That held on both rigs (on Carbon, the "without" pass covered the build only). With the zonemanager.ignoreflag.* exemption the flags step aside.

Checklist

  • I have read CONTRIBUTING.md.
  • The change builds and existing tests/checks pass locally.
  • I have added or updated tests/docs where it makes sense.
  • My commits are reasonably scoped with clear messages.

AI-assisted contributions (required)

  • No AI tools were used to produce this contribution.
  • AI tools were used. Tool(s): Claude Code (Claude Opus 5.5). I have reviewed and understand
    every change, and take responsibility for it. AI-authored commits are
    marked with a Co-Authored-By / Assisted-By trailer.

License

  • I agree that my contribution is licensed under this project's license
    (GNU GPL v3.0 or later), and I have the right to contribute it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

## What & why The RunicNPC 9d server-side walk (docs PR in this series) found three faults on both rigs. The org lead chose to fix all three ("Fix the animal kill things", the ZoneManager patch, and heals from an example). - **D320, animal kills (bridge).** Rust's animals are now `Rust.Ai.Gen2.BaseNPC2`: stag, boar, wolf, bears, big cats, crocodile, farm animals, critters and sea life. The bridge tested `BaseNpc` alone, so an animal kill counted neither in `animalKills` nor in `npcKills`. Every `BaseNPC2` now counts as an animal, except `ScientistNPC2`, the one person among them, which counts as a human NPC kill. - **D321, heals (bridge).** `OnHealingItemUse` is `(tool, fromPlayer, toTarget)`. The two-parameter handler received the healer as the target and dropped every heal as healing yourself, so "Players healed" counted revives only. It now reads the target. A syringe revive raises both hooks, the heal first, so one shared `CountHelp` counts one act of help once, whichever hook comes first. - **D322, zone flags (RunicGatewayZones 0.2.0).** ZoneManager 3.1.14 subscribes the hooks behind its flags only for the zones it had when it loaded. A zone opened later through its API, which is every event zone, enforced nothing. The helper's existing postfix sees every zone that is created, updated or loaded; it now also has ZoneManager run its own `UpdateHookSubscriptions` on the next tick, before entering the players already inside. A ZoneManager without that method is warned about and shown by `rgz.status`. No message changes shape; protocol stays 13. ## How it was tested - `node scripts/checkPlugin.js`: plugin ok, protocol 13, 54 hooks. `node --test scripts/checkPlugin.test.js`: 14/14. - Compiled and loaded on **both rigs** (Rust 25681086, Oxide 2.0.7801, Carbon 2.0.262). - **D320 and D321:** stand-in players drove Rust's own code: a revolver kill on a stag, a machete kill on a boar, a bandage on another player, and a syringe revive of a downed one. Read back on the walk site, each rig moved by exactly +2 `npc_kills`, +2 `animal_kills` and +2 `healed`. Before the fix, 4 animal kills gave 0 and no bandage counted. - **D322:** each pass started from a reloaded ZoneManager, with an event opening the Arena preset (NoBuild, PvpGod, …): | | PvP inside the zone | Build inside the zone | |---|---|---| | Without the helper | the victim died in 3 hits | the foundation still stood | | With 0.2.0 | 0 damage in 40 hits | foundation removed within 3 s | That held on both rigs (on Carbon, the "without" pass covered the build only). With the `zonemanager.ignoreflag.*` exemption the flags step aside. ## Checklist - [x] I have read [CONTRIBUTING.md](CONTRIBUTING.md). - [x] The change builds and existing tests/checks pass locally. - [x] I have added or updated tests/docs where it makes sense. - [x] My commits are reasonably scoped with clear messages. ## AI-assisted contributions (required) - [ ] No AI tools were used to produce this contribution. - [x] AI tools were used. Tool(s): `Claude Code (Claude Opus 5.5)`. I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a `Co-Authored-By` / `Assisted-By` trailer. ## License - [x] I agree that my contribution is licensed under this project's license (**GNU GPL v3.0 or later**), and I have the right to contribute it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 2 commits 2026-10-07 13:44:07 -05:00
- Animal kills: Rust's animals are now Rust.Ai.Gen2.BaseNPC2 (stag, boar, wolf,
  bears, big cats, crocodile, farm animals, critters, sea life), not BaseNpc, so
  no animal kill counted as an animal or an NPC kill. They count as both again;
  ScientistNPC2, the one person among them, counts as a human NPC kill.
- Heals: OnHealingItemUse is (tool, fromPlayer, toTarget). The bridge took two
  parameters, received the healer as the target, and dropped every heal as
  healing yourself. It now reads the target, and one act of help (a syringe
  revive raises both hooks, the heal first) counts once whichever hook comes
  first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
fix(zones): an event's zone enforces its flags (RunicGatewayZones 0.2.0, runicnpc 9d)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 13s
a785ad91ef
ZoneManager subscribes the hooks that enforce its flags only for the zones it
had when it loaded; a zone made later through its API, which is every zone an
event opens, never re-subscribes them, so an event's PvpGod or NoBuild zone
enforced nothing. The helper's postfix, which already sees every zone created,
updated or loaded, now has ZoneManager run its own UpdateHookSubscriptions on
the next tick, before entering the players already inside. A ZoneManager
without that method is warned about and reported by rgz.status; the first job
still works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech merged commit d391c521c7 into edge 2026-10-07 13:47:16 -05:00
whitlocktech deleted branch fix/walk-titles-zones 2026-10-07 13:47:17 -05:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/Rust-Plugins#28
No description provided.