From 9dbd0a4bafb0dd09bfc9c9898d6971ca05a2e448 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 19:19:36 +0100 Subject: [PATCH] Make the strafing dragon charge its fireball only with a clear line of sight --- crates/horizon-client/src/game/dragon.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/dragon.rs b/crates/horizon-client/src/game/dragon.rs index fff03ef1c..43a3124d8 100644 --- a/crates/horizon-client/src/game/dragon.rs +++ b/crates/horizon-client/src/game/dragon.rs @@ -1374,7 +1374,16 @@ impl Game<'_> { } } let d2 = (pp.x - pos.x).powi(2) + (pp.y - pos.y).powi(2) + (pp.z - pos.z).powi(2); - if d2 < 4096.0 { + // Entity.hasLineOfSight: eye to eye (the dragon's eye is 0.85 of + // its 8 block height), blocks only. + let sees = d2 < 4096.0 && { + let eye = Vec3::new(pos.x, pos.y + 6.8, pos.z); + let target_eye = + tracked.map_or(pp.y + 1.62, |p| p.bounds.max_position().y - 0.18); + self.mob_world_base(&[]) + .line_of_sight(eye, Vec3::new(pp.x, target_eye, pp.z)) + }; + if sees { *charge += 1; let d = self.dragon.as_ref().expect("dragon"); let r = d.yaw.to_radians();