riding: the crosshair skips the mob being ridden, so it can't be hit

Fixes #2870.
This commit is contained in:
iLostName committed 2026-10-28 06:52:28 +01:00
1 parent 56f968e11c
commit 7934a0b180
1 file changed
+3 -1
+3 -1
View File
@@ -8390,7 +8390,9 @@ impl Game<'_> {
let reach: f64 = if self.creative { 5.0 } else { 3.0 };
let mut best: Option<(usize, f64)> = None;
for (i, m) in self.mobs.iter().enumerate() {
if !m.alive() {
// ProjectileUtil.getEntityHitResult: the mob the player rides
// shares its root vehicle and is never the hit.
if !m.alive() || Some(m.id) == self.riding {
continue;
}
if let Some(t) = ray_box(eye, dir, reach, m.bounds())