[PR #6472] [CLOSED] Crossbow: a charge moved past both points plays both loading sounds #6898

Closed
opened 2026-11-03 06:28:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6472
Author: @Domanffe
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: fix/crossbow-loading-sounds


📝 Commits (1)

  • 18a24ed Crossbow: a charge moved past both points plays both loading sounds

📊 Changes

2 files changed (+47 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/crossbow.rs (+44 -3)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

Fixes #6145

tick_crossbow played a loading sound only when the charge crossed its point
between two ticks (before < 0.2 && now >= 0.2). A mod's
native_living_entity_use_item_tick can move the ticks left, so one tick can
jump the charge past both points, and then neither the start nor the middle
sound plays while the crossbow still loads.

Vanilla's CrossbowItem.onUseTick keeps startSoundPlayed and
midLoadSoundPlayed, resets both while the charge is under 0.2, and plays a
sound once the charge is at or past its point if that sound has not played yet.
This does the same: the two flags live on Game beside using, and the test
a_charge_that_jumps_past_both_points_plays_both_sounds pins a 0.1 to 1.0 jump
(two sounds), a charge held past both (none again), the reset under 0.2, and a
charge that reaches only the first point.

Verified: cargo test -p horizon-client --bin horizon-client jumps_past_both_points passes, and cargo check -p horizon-client --all-targets
compiles the binary the game runs.

What I did not observe: the sounds themselves in a running game with a tick
hook that moves a crossbow's charge. The unit test covers the decision, not the
playback, and the hearing test needs the mod the issue names.

The pr_ready block follows as a comment.


🔄 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/6472 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/crossbow-loading-sounds` --- ### 📝 Commits (1) - [`18a24ed`](https://github.com/horizon-rust/horizon/commit/18a24ed312f150f2d16df65cc54bb4a8f9e4ca31) Crossbow: a charge moved past both points plays both loading sounds ### 📊 Changes **2 files changed** (+47 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/crossbow.rs` (+44 -3) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. Fixes #6145 `tick_crossbow` played a loading sound only when the charge crossed its point between two ticks (`before < 0.2 && now >= 0.2`). A mod's `native_living_entity_use_item_tick` can move the ticks left, so one tick can jump the charge past both points, and then neither the start nor the middle sound plays while the crossbow still loads. Vanilla's `CrossbowItem.onUseTick` keeps `startSoundPlayed` and `midLoadSoundPlayed`, resets both while the charge is under 0.2, and plays a sound once the charge is at or past its point if that sound has not played yet. This does the same: the two flags live on `Game` beside `using`, and the test `a_charge_that_jumps_past_both_points_plays_both_sounds` pins a 0.1 to 1.0 jump (two sounds), a charge held past both (none again), the reset under 0.2, and a charge that reaches only the first point. Verified: `cargo test -p horizon-client --bin horizon-client jumps_past_both_points` passes, and `cargo check -p horizon-client --all-targets` compiles the binary the game runs. What I did not observe: the sounds themselves in a running game with a tick hook that moves a crossbow's charge. The unit test covers the decision, not the playback, and the hearing test needs the mod the issue names. The `pr_ready` block follows as a comment. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:28:47 +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#6898
No description provided.