From 58422bcc19ecf7dd2294a015c3ac897b2d3183bc Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 22:54:14 +0100 Subject: [PATCH] Bred babies keep the classic sound set; allays walk back to within 4 blocks - Animal.spawnChildFromBreeding creates the baby with getBreedOffspring and no finalizeSpawn, so its sound variant stays the default (classic); the spawn path here had just drawn a random one. - StayCloseToTarget sets a walk target with closeEnough 4: once started at 16 blocks, the allay walks until MoveToTargetSink.reachedTarget (Manhattan block distance 4), not only back inside 16. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/creatures.rs | 3 +++ crates/horizon-client/src/mobs/allay.rs | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index 090f373b5..2a0ba2dcd 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -1859,6 +1859,9 @@ impl Game<'_> { && let Some(child) = self.mobs.iter_mut().find(|m| m.id == id) { child.extra.age = -24000; + // getBreedOffspring creates the baby without finalizeSpawn: it keeps + // the default (`classic`) sound variant. + child.extra.sound_variant = None; // A llama's baby was drawn in the parent's tick, with the // experience. if let Some(o) = llama { diff --git a/crates/horizon-client/src/mobs/allay.rs b/crates/horizon-client/src/mobs/allay.rs index ebc53ae49..8c2ced406 100644 --- a/crates/horizon-client/src/mobs/allay.rs +++ b/crates/horizon-client/src/mobs/allay.rs @@ -113,6 +113,18 @@ impl Goal for StayClose { d >= 256.0 }) } + /// `MoveToTargetSink.reachedTarget`: the walk target it set is reached + /// within a Manhattan block distance of 4 (`closeEnough`). + fn can_continue(&mut self, m: &mut Mob, cx: &mut Cx) -> bool { + m.extra.point.is_none() + && deposit(m, cx).is_some_and(|p| { + let at = [m.position.x, m.position.y, m.position.z]; + (0..3) + .map(|i| (p[i].floor() as i32 - at[i].floor() as i32).abs()) + .sum::() + > 4 + }) + } fn tick(&mut self, m: &mut Mob, cx: &mut Cx) { if let Some(p) = deposit(m, cx) && (m.ai.nav.is_done() || m.age.is_multiple_of(10))