[PR #3056] [MERGED] Spears: charges hit while riding, and a stab stops the sprint #4771

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3056
Author: @kacpherek
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/spear-charge-while-riding


📝 Commits (2)

  • 3303143 Give a mounted spear charge its mount's speed
  • 4a1c5fc Stop sprinting after a spear stab with knockback

📊 Changes

1 file changed (+11 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/spear.rs (+11 -1)

📄 Description

What and why

  • Reported in #3019: riding a horse at a zombie with the spear charge held does nothing.

  • KineticWeapon.damageEntities scales damage, knockback and dismount by the attacker's speed along the look, from getKnownSpeed. For a rider, ServerPlayer.getKnownSpeed is the vehicle's movement (or the vehicle move its client sent when it drives).

  • Horizon took the speed from the player's own last move packet. A rider sends vehicle moves instead, so the charge had a speed of 0 on horseback, failed every condition and hit nothing.

  • The acting player's known movement is now its mount's movement while riding a mob (horse, camel, pig, strider and so on), through the same root-vehicle lookup targets already use. It works for the host and for LAN guests, since riding is the acting player's vehicle.

  • A stab with knockback now stops the attacker's sprint (Player.causeExtraKnockback), like the melee path already did.

Fixes #3019

Vanilla reference

KineticWeapon.java:78-84 (getMotion uses getKnownSpeed), ServerPlayer.java:2411-2414 (a rider's known speed is the vehicle's), ServerGamePacketListenerImpl.java:519-520 (a driven vehicle's move becomes the known movement), Player.java:1166-1190 (setSprinting(false)).

Self-check

fmt passes. Built and tested by this pull request's checks. Not run in game.


🔄 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/3056 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/spear-charge-while-riding` --- ### 📝 Commits (2) - [`3303143`](https://github.com/horizon-rust/horizon/commit/330314327a7b8f6fadd878399d54aa6de5774586) Give a mounted spear charge its mount's speed - [`4a1c5fc`](https://github.com/horizon-rust/horizon/commit/4a1c5fc54c02502df1bd6233f913c20a16822ca9) Stop sprinting after a spear stab with knockback ### 📊 Changes **1 file changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/spear.rs` (+11 -1) </details> ### 📄 Description ## What and why - Reported in #3019: riding a horse at a zombie with the spear charge held does nothing. - `KineticWeapon.damageEntities` scales damage, knockback and dismount by the attacker's speed along the look, from `getKnownSpeed`. For a rider, `ServerPlayer.getKnownSpeed` is the vehicle's movement (or the vehicle move its client sent when it drives). - Horizon took the speed from the player's own last move packet. A rider sends vehicle moves instead, so the charge had a speed of 0 on horseback, failed every condition and hit nothing. - The acting player's known movement is now its mount's movement while riding a mob (horse, camel, pig, strider and so on), through the same root-vehicle lookup targets already use. It works for the host and for LAN guests, since `riding` is the acting player's vehicle. - A stab with knockback now stops the attacker's sprint (`Player.causeExtraKnockback`), like the melee path already did. Fixes #3019 ## Vanilla reference `KineticWeapon.java:78-84` (`getMotion` uses `getKnownSpeed`), `ServerPlayer.java:2411-2414` (a rider's known speed is the vehicle's), `ServerGamePacketListenerImpl.java:519-520` (a driven vehicle's move becomes the known movement), `Player.java:1166-1190` (`setSprinting(false)`). ## Self-check fmt passes. Built and tested by this pull request's checks. Not run in game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:49 +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#4771
No description provided.