[PR #4959] [MERGED] Stop a NoAI allay dancing, fetching and delivering #5973

Closed
opened 2026-11-03 05:16:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4959
Author: @MSedgeMC
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/allay-no-ai-dance


📝 Commits (2)

  • e35e3e3 Keep the touch pickup a NoAI allay still has
  • 830820b Write the em dash back as an em dash

📊 Changes

2 files changed (+79 additions, -21 deletions)

View changed files

📝 crates/horizon-client/src/game/allays.rs (+35 -20)
📝 crates/horizon-client/src/mobs/allay.rs (+44 -1)

📄 Description

From the port ledger's Allay.setDancing / tick_allays rows. (No issue.)

Allay.setDancing only marks an allay dancing when isEffectiveAi() is true, and a mob whose AI is off never runs its brain at all — so a NoAI allay neither dances nor picks up and delivers items. Horizon does both from Game::tick_allays rather than from goals: it scans playing jukeboxes within 10 blocks and sets the dance flag, then does the allay's pickup and delivery in the same loop. Nothing looked at the mob's AI flag, so /data merge … {NoAI:1b} left an allay dancing to a jukebox and still fetching and throwing what it found.

The dance rule is now a pure helper in mobs/allay.rs — no AI, not panicking, within the 10-block reach whose radius was already right — and the tick skips the rest of the allay's work when no_ai is set. The jukebox scan, the radius, the panic check and the single writer of the dance flag are otherwise unchanged.

What is proven: cargo test -p horizon-client --lib allay_parity_tests → 3 passed on a build box: a NoAI allay does not dance at any distance inside the reach while an AI-enabled one does, out-of-reach stays false, and a panicking allay never dances.

What is not proven: the game-level check — spawn an allay beside a playing jukebox, /data merge … {NoAI:1b}, and watch it neither dance nor fetch; then {NoAI:0b} and watch both happen. There is no Game fixture in the crate and every Mob fixture needs the prepared vanilla data, so the helper takes three scalars instead; that keeps the test runnable anywhere but leaves the wiring asserted only by reading it. pr_ready was not run, so CI's verify is the workspace check.

One related deviation is left alone deliberately and named here rather than fixed: vanilla's shouldStopDancing rechecks the jukebox every 20 ticks and Horizon only polls each tick, so a stopped disc stops Horizon a fraction of a second sooner. It is invisible in play and would need a jukeboxPos field to model.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4959 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/allay-no-ai-dance` --- ### 📝 Commits (2) - [`e35e3e3`](https://github.com/horizon-rust/horizon/commit/e35e3e3ca0563cce612c49537fb557a3bec68c96) Keep the touch pickup a NoAI allay still has - [`830820b`](https://github.com/horizon-rust/horizon/commit/830820b2cf331f3126b139929ec8e9c28b95272d) Write the em dash back as an em dash ### 📊 Changes **2 files changed** (+79 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/allays.rs` (+35 -20) 📝 `crates/horizon-client/src/mobs/allay.rs` (+44 -1) </details> ### 📄 Description From the port ledger's `Allay.setDancing` / `tick_allays` rows. (No issue.) `Allay.setDancing` only marks an allay dancing when `isEffectiveAi()` is true, and a mob whose AI is off never runs its brain at all — so a `NoAI` allay neither dances nor picks up and delivers items. Horizon does both from `Game::tick_allays` rather than from goals: it scans playing jukeboxes within 10 blocks and sets the dance flag, then does the allay's pickup and delivery in the same loop. Nothing looked at the mob's AI flag, so `/data merge … {NoAI:1b}` left an allay dancing to a jukebox and still fetching and throwing what it found. The dance rule is now a pure helper in `mobs/allay.rs` — no AI, not panicking, within the 10-block reach whose radius was already right — and the tick skips the rest of the allay's work when `no_ai` is set. The jukebox scan, the radius, the panic check and the single writer of the dance flag are otherwise unchanged. **What is proven:** `cargo test -p horizon-client --lib allay_parity_tests` → 3 passed on a build box: a NoAI allay does not dance at any distance inside the reach while an AI-enabled one does, out-of-reach stays false, and a panicking allay never dances. **What is not proven:** the game-level check — spawn an allay beside a playing jukebox, `/data merge … {NoAI:1b}`, and watch it neither dance nor fetch; then `{NoAI:0b}` and watch both happen. There is no `Game` fixture in the crate and every `Mob` fixture needs the prepared vanilla data, so the helper takes three scalars instead; that keeps the test runnable anywhere but leaves the wiring asserted only by reading it. `pr_ready` was not run, so CI's `verify` is the workspace check. One related deviation is left alone deliberately and named here rather than fixed: vanilla's `shouldStopDancing` rechecks the jukebox every 20 ticks and Horizon only polls each tick, so a stopped disc stops Horizon a fraction of a second sooner. It is invisible in play and would need a `jukeboxPos` field to model. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:19 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
horizon-rust/horizon#5973
No description provided.