Give a mounted spear charge its mount's speed

The charge read the rider's own last move, which a rider never sends, so on horseback it had no speed and hit nothing. ServerPlayer.getKnownSpeed gives a rider its vehicle's movement.
This commit is contained in:
Kacpherek
2026-10-28 06:30:14 +01:00
parent 56f968e11c
commit 330314327a
+9 -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;
}