[PR #4690] [MERGED] name player killers in death message #5782

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4690
Author: @calclb
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/4529-player-death-message


📝 Commits (3)

  • 4d06304 name player killers in death message
  • 48beef0 Merge main; drop the melee killer note that #4927 already adds
  • 9b74114 Clear the projectile attacker after a refused hit; name the host by its own name

📊 Changes

4 files changed (+157 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game/combat.rs (+2 -0)
📝 crates/horizon-client/src/game/creatures.rs (+3 -0)
📝 crates/horizon-client/src/game/lan_pvp.rs (+46 -3)
📝 tools/lan_e2e.py (+106 -2)

📄 Description

🤖 Opened by calclb's AI agent (omp, deepseek-v4.1-flash), not by calclb personally.

Fixes #4529. Player-caused deaths printed %1$s was slain by %2$s raw, because CombatTracker only ever learned mob attackers. lan_pvp.rs now records the attacker's entity id and display name for melee, sweeps, arrows and thorns (player_attacker, and combat.projectile_attacker for a player's projectile), and hurt_player_from turns it into the damage source's causing entity. Only the death message changes: difficulty scaling and the mob path are untouched. tools/lan_e2e.py --check deaths covers the five cases.

Two pieces stay out, for a follow-up issue: a custom-named weapon does not produce death.attack.<kind>.item yet, and a player-lit TNT blast still reads "blew up" where vanilla names the igniter.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf
  • feature
  • extra
  • tooling
  • docs

Vanilla reference

CombatTracker.getDeathMessage, DamageSource.getLocalizedDeathMessage (the causing entity is %2$s), Player.attack and Player.doSweepAttack (both damageSources().playerAttack(this)), AbstractArrow.onHitEntity, DamageSources.thorns(wearer).

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main, against upstream/main at 0b95a7a92, 4 min 30 s)

Check Result
Scope ✅ 4 files, +158 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (23 s)
rustfmt ✅ (4 s)
clippy ✅ (54 s)
tests: horizon-client ✅ 1153 passed (3 min 8 s)
doc tests ✅ 0 passed (1 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/4690 **Author:** [@calclb](https://github.com/calclb) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/4529-player-death-message` --- ### 📝 Commits (3) - [`4d06304`](https://github.com/horizon-rust/horizon/commit/4d0630488d654ed05b17090c38c3b7fb5ec80a6e) name player killers in death message - [`48beef0`](https://github.com/horizon-rust/horizon/commit/48beef082a7e9c018c1d624e1530c3d3510b4693) Merge main; drop the melee killer note that #4927 already adds - [`9b74114`](https://github.com/horizon-rust/horizon/commit/9b74114b8a88bc458971e18a6ed6c14ca911ac89) Clear the projectile attacker after a refused hit; name the host by its own name ### 📊 Changes **4 files changed** (+157 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/combat.rs` (+2 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -0) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+46 -3) 📝 `tools/lan_e2e.py` (+106 -2) </details> ### 📄 Description > 🤖 Opened by calclb's AI agent (omp, deepseek-v4.1-flash), not by calclb personally. Fixes #4529. Player-caused deaths printed `%1$s was slain by %2$s` raw, because `CombatTracker` only ever learned mob attackers. `lan_pvp.rs` now records the attacker's entity id and display name for melee, sweeps, arrows and thorns (`player_attacker`, and `combat.projectile_attacker` for a player's projectile), and `hurt_player_from` turns it into the damage source's causing entity. Only the death message changes: difficulty scaling and the mob path are untouched. `tools/lan_e2e.py --check deaths` covers the five cases. Two pieces stay out, for a follow-up issue: a custom-named weapon does not produce `death.attack.<kind>.item` yet, and a player-lit TNT blast still reads "blew up" where vanilla names the igniter. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf - [ ] feature - [ ] extra - [ ] tooling - [ ] docs ## Vanilla reference `CombatTracker.getDeathMessage`, `DamageSource.getLocalizedDeathMessage` (the causing entity is `%2$s`), `Player.attack` and `Player.doSweepAttack` (both `damageSources().playerAttack(this)`), `AbstractArrow.onHitEntity`, `DamageSources.thorns(wearer)`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main`, against upstream/main at 0b95a7a92, 4 min 30 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +158 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (23 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (54 s) | | tests: horizon-client | ✅ 1153 passed (3 min 8 s) | | doc tests | ✅ 0 passed (1 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:57 +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#5782
No description provided.