[PR #3873] [MERGED] Fix breeding advancement and statistic on the server thread #5263

Closed
opened 2026-11-03 05:11:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3873
Author: @DUzzL
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/issue-3863-breed-advancement


📝 Commits (1)

  • a8f0a64 Credit breeding to the player who fed the animals

📊 Changes

6 files changed (+58 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -0)
📝 crates/horizon-client/src/game/creatures.rs (+44 -4)
📝 crates/horizon-client/src/game/llamas.rs (+1 -0)
📝 crates/horizon-client/src/game/mounts.rs (+1 -0)
📝 crates/horizon-client/src/game/nautili.rs (+2 -0)
📝 crates/horizon-client/src/game/pandas.rs (+6 -0)

📄 Description

🤖 Opened by DUzzL's AI agent, not by DUzzL personally.

Fixes #3863

Cause

Breeding runs in the mob tick (Game::breed), outside any player's turn. On the server thread, the default for single player, the server has no host player, so trigger bailed out with no_player_here(). The bred_animals trigger and the animals_bred statistic were dropped, and "The Parrots and the Bats" was never granted. The old check also only looked at the parent's love_player flag.

Fix

  • Remember who fed each animal into love (Animal.loveCause): Game::love_cause maps mob id to the guest connection, or None for the host. It is set wherever an animal falls in love from a click (ordinary animals, llamas, horses and donkeys, nautili, pandas).
  • breed credits the parent's feeder, else the partner's, as finalizeSpawnChildFromBreeding does. It runs the stat and trigger as that player (for_player), the same way channeling and sculk catalyst credit work.
  • The entry is dropped when either animal breeds or the mob dies.

Tests

  • New unit test game::creatures::breeding_tests for the credit resolution.
  • cargo test -p horizon-client --bins breeding_tests: pass. cargo clippy -p horizon-client --lib --bins --tests: no new warnings (a log_display dead-code warning in horizon-client-render already exists on Windows).
  • Not run: the vanilla-data harnesses and lan_e2e (no .local/ data on this machine).

🔄 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/3873 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/issue-3863-breed-advancement` --- ### 📝 Commits (1) - [`a8f0a64`](https://github.com/horizon-rust/horizon/commit/a8f0a64bd6c75f7a70cc778680cf2960a1cc665b) Credit breeding to the player who fed the animals ### 📊 Changes **6 files changed** (+58 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+44 -4) 📝 `crates/horizon-client/src/game/llamas.rs` (+1 -0) 📝 `crates/horizon-client/src/game/mounts.rs` (+1 -0) 📝 `crates/horizon-client/src/game/nautili.rs` (+2 -0) 📝 `crates/horizon-client/src/game/pandas.rs` (+6 -0) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Fixes #3863 ## Cause Breeding runs in the mob tick (`Game::breed`), outside any player's turn. On the server thread, the default for single player, the server has no host player, so `trigger` bailed out with `no_player_here()`. The `bred_animals` trigger and the `animals_bred` statistic were dropped, and "The Parrots and the Bats" was never granted. The old check also only looked at the parent's `love_player` flag. ## Fix - Remember who fed each animal into love (`Animal.loveCause`): `Game::love_cause` maps mob id to the guest connection, or `None` for the host. It is set wherever an animal falls in love from a click (ordinary animals, llamas, horses and donkeys, nautili, pandas). - `breed` credits the parent's feeder, else the partner's, as `finalizeSpawnChildFromBreeding` does. It runs the stat and trigger as that player (`for_player`), the same way channeling and sculk catalyst credit work. - The entry is dropped when either animal breeds or the mob dies. ## Tests - New unit test `game::creatures::breeding_tests` for the credit resolution. - `cargo test -p horizon-client --bins breeding_tests`: pass. `cargo clippy -p horizon-client --lib --bins --tests`: no new warnings (a `log_display` dead-code warning in horizon-client-render already exists on Windows). - Not run: the vanilla-data harnesses and `lan_e2e` (no `.local/` data on this machine). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:22 +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#5263
No description provided.