[PR #2495] [MERGED] Only a tame wolf's or cat's owner can command it, and pets follow their owner #4366

Closed
opened 2026-11-03 04:16:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2495
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/pet-owner-checks


📝 Commits (3)

  • 77fe538 Let only the owner command a tame wolf or cat, and make pets follow their owner
  • d2a8cf3 Keep a hurt pet's attacker as its player instead of swapping in the owner
  • 79fca90 Tame a pet to the player's real UUID, not an unset placeholder

📊 Changes

3 files changed (+49 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+17 -5)
📝 crates/horizon-client/src/game/lan_mobs.rs (+17 -1)
📝 crates/horizon-client/src/mobs/tame.rs (+15 -9)

📄 Description

What and why

Wolves and cats did not check their saved owner. Any nearby player could make someone else's pet sit or stand, and the follow, teleport-to-owner and owner-hurt goals used the nearest player instead of the owner, so in LAN a pet followed or defended whoever was closest.

  • Sitting a tame wolf or cat, dyeing the collar and healing a cat now need the acting player (host or guest) to be the saved owner. Healing a wolf stays open to anyone, as in vanilla.
  • owner() in mobs/tame.rs returns nothing unless the player the mob sees is the saved owner, so the follow, teleport, sit-when-ordered and owner-hurt goals ignore everyone else.
  • player_for in game/lan_mobs.rs hands a tame wolf or cat its owner while the owner is in play.
  • Taming a wolf or cat saves the acting player's UUID, so a guest who tames one owns it.

Vanilla reference

Wolf.mobInteract, Cat.mobInteract, TamableAnimal.getOwner, TamableAnimal.isOwnedBy, FollowOwnerGoal, OwnerHurtByTargetGoal, OwnerHurtTargetGoal, SitWhenOrderedToGoal.

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2495 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/pet-owner-checks` --- ### 📝 Commits (3) - [`77fe538`](https://github.com/horizon-rust/horizon/commit/77fe538e09b0b8677634083d6fdca88d9f543b45) Let only the owner command a tame wolf or cat, and make pets follow their owner - [`d2a8cf3`](https://github.com/horizon-rust/horizon/commit/d2a8cf3bdfffbca0f77f897db5a03fa2b13ced1a) Keep a hurt pet's attacker as its player instead of swapping in the owner - [`79fca90`](https://github.com/horizon-rust/horizon/commit/79fca908869c1a6a2e44f5a5e1a56de083db644f) Tame a pet to the player's real UUID, not an unset placeholder ### 📊 Changes **3 files changed** (+49 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+17 -5) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+17 -1) 📝 `crates/horizon-client/src/mobs/tame.rs` (+15 -9) </details> ### 📄 Description ## What and why Wolves and cats did not check their saved owner. Any nearby player could make someone else's pet sit or stand, and the follow, teleport-to-owner and owner-hurt goals used the nearest player instead of the owner, so in LAN a pet followed or defended whoever was closest. - Sitting a tame wolf or cat, dyeing the collar and healing a cat now need the acting player (host or guest) to be the saved owner. Healing a wolf stays open to anyone, as in vanilla. - `owner()` in `mobs/tame.rs` returns nothing unless the player the mob sees is the saved owner, so the follow, teleport, sit-when-ordered and owner-hurt goals ignore everyone else. - `player_for` in `game/lan_mobs.rs` hands a tame wolf or cat its owner while the owner is in play. - Taming a wolf or cat saves the acting player's UUID, so a guest who tames one owns it. ## Vanilla reference `Wolf.mobInteract`, `Cat.mobInteract`, `TamableAnimal.getOwner`, `TamableAnimal.isOwnedBy`, `FollowOwnerGoal`, `OwnerHurtByTargetGoal`, `OwnerHurtTargetGoal`, `SitWhenOrderedToGoal`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:38 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4366
No description provided.