From d5aa3f6e4256e8631cd14a1ad651fab5074f9efe Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:11:34 +0100 Subject: [PATCH] Name the cat relax goal's owner check is_owner_of The tame mob goals (#2382, #2399) add an is_owner(m, w) to this module. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/mobs/tame.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/horizon-client/src/mobs/tame.rs b/crates/horizon-client/src/mobs/tame.rs index 5ac5d72dc..bd846ebc2 100644 --- a/crates/horizon-client/src/mobs/tame.rs +++ b/crates/horizon-client/src/mobs/tame.rs @@ -795,7 +795,7 @@ fn empty_above(w: &MobWorld, p: [i32; 3]) -> bool { } /// Whether `p` is the player that owns `m` (a cat without a recorded owner /// belongs to whoever it sees). -pub fn is_owner(m: &Mob, p: &super::PlayerView) -> bool { +pub fn is_owner_of(m: &Mob, p: &super::PlayerView) -> bool { m.extra.owner.is_none_or(|o| o == p.uuid) } /// `Cat.CatRelaxOnOwnerGoal`: while the owner sleeps, the cat lies down beside @@ -830,7 +830,7 @@ impl CatRelaxOnOwner { fn sleeping_owner<'w>(m: &Mob, w: &'w MobWorld) -> Option<&'w super::PlayerView> { w.player .as_ref() - .filter(|p| m.extra.tame && !m.extra.sitting && p.sleeping && is_owner(m, p)) + .filter(|p| m.extra.tame && !m.extra.sitting && p.sleeping && is_owner_of(m, p)) } } impl Goal for CatRelaxOnOwner { @@ -894,7 +894,7 @@ impl Goal for CatRelaxOnOwner { .w .player .as_ref() - .is_some_and(|p| is_owner(m, p) && p.sleep_timer >= 100) + .is_some_and(|p| is_owner_of(m, p) && p.sleep_timer >= 100) && m.random.next_float() < chance { give_morning_gift(m, cx);