Merge pull request #3056 from kacpherek/fix/spear-charge-while-riding

🤖 Agent: read the diff at 4a1c5fc54 ("Spears: charges hit while riding, and a stab stops the sprint") against the 26.3 source it cites; verify green, merges cleanly with main. Proof: cg25 union a051cc285 (local branch cg25/union in t3-ef805fdb: main 6d3489d30 + 38 contributor heads merged cleanly, no fixups): clippy -p horizon-client --all-targets -D warnings clean, horizon-client lib 1105 + bin 133 + integration tests pass, parity --changed 355/355 harnesses PASS on the Mac mini (Cargo.lock changed by #3210, so every harness ran; tab_list passed on its one retry).
This commit is contained in:
Ludovic Marie
2026-10-28 19:50:42 +01:00
committed by GitHub
+11 -1
View File
@@ -44,8 +44,16 @@ impl Game<'_> {
}
/// `ServerPlayer.getKnownMovement` of the acting player: what they moved
/// in the last tick. A guest's comes with their moves.
/// in the last tick. A guest's comes with their moves. A rider's is its
/// mount's move (`getKnownSpeed`: the vehicle's, or the move the driver's
/// client sent for it), so a charge on horseback carries the horse's speed.
fn known_player_movement(&self) -> Vec3 {
if let Some(i) = self
.riding
.and_then(|v| self.mobs.iter().position(|m| m.id == v))
{
return self.mob_speed(i).scale(1.0 / 20.0);
}
if self.lan_acting.is_some() {
return self.known_movement;
}
@@ -242,6 +250,8 @@ impl Game<'_> {
self.mobs[index].knockback(0.4, xd, zd);
let (strength, _) = self.extra_knockback(&kind, 0.0);
self.mobs[index].knockback(f64::from(strength), xd, zd);
// ...and the attacker stops sprinting.
self.stop_sprint_after_extra_knockback();
}
let dismounted = dismounts && self.mobs[index].extra.mount.is_some();
if dismounted {