[PR #3668] [MERGED] /damage hurts players other than the one running it #5137

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

📋 Pull Request Information

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

Base: main ← Head: fix/damage-other-players


📝 Commits (1)

  • 5601fea Let /damage hurt players other than the acting one

📊 Changes

2 files changed (+26 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/game/commands/world_cmds.rs (+16 -14)
📝 tools/lan_e2e.py (+10 -1)

📄 Description

🤖 Opened by martipops's AI agent (Claude Code), not by martipops themselves.

Closes #3665.

/damage only handled the acting player and mobs: any other player (a LAN guest, every player on a dedicated server, a splitscreen player) fell through to _ => false and got "Target is invulnerable" without a health check. It now runs as that player through for_player, as /effect already does. The causing entity is still noted for the death message, and a spectator is still not hurt.

  • crates/horizon-client/src/game/commands/world_cmds.rs: cmd_damage takes Target::Player | Target::Guest(_) through for_player.
  • tools/lan_e2e.py --check damage: the host's /damage Guest 4 now has to answer "Applied 4.0 damage to Guest" and lower the guest's health (it passes locally; before the fix the command reported "Target is invulnerable").

No overlap with #2951, which adds missing damage types to damage_kind. Also included in #3541 (splitscreen), whose profile tests damage another player; it drops out of that PR once this one merges.

Vanilla reference: DamageCommand.damage hurts any entity target, players included.

pr_ready (tools/pr_ready.py --quick --base upstream/main on Mac, against upstream/main at 3c63c5913, 7 min 6 s)

Check Result
Scope ✅ 2 files, +26 −15
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (23 s)
rustfmt ✅ (3 s)
clippy ✅ (1 min 2 s)
tests: horizon-client ✅ 804 passed (4 min 44 s)
doc tests ✅ 0 passed (43 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 31 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 19 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 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/3668 **Author:** [@martipops](https://github.com/martipops) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/damage-other-players` --- ### 📝 Commits (1) - [`5601fea`](https://github.com/horizon-rust/horizon/commit/5601fea75eda49bb5aa604e6b1038eee9e5a961a) Let /damage hurt players other than the acting one ### 📊 Changes **2 files changed** (+26 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands/world_cmds.rs` (+16 -14) 📝 `tools/lan_e2e.py` (+10 -1) </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Claude Code), not by martipops themselves. Closes #3665. `/damage` only handled the acting player and mobs: any other player (a LAN guest, every player on a dedicated server, a splitscreen player) fell through to `_ => false` and got "Target is invulnerable" without a health check. It now runs as that player through `for_player`, as `/effect` already does. The causing entity is still noted for the death message, and a spectator is still not hurt. - `crates/horizon-client/src/game/commands/world_cmds.rs`: `cmd_damage` takes `Target::Player | Target::Guest(_)` through `for_player`. - `tools/lan_e2e.py --check damage`: the host's `/damage Guest 4` now has to answer "Applied 4.0 damage to Guest" and lower the guest's health (it passes locally; before the fix the command reported "Target is invulnerable"). No overlap with #2951, which adds missing damage types to `damage_kind`. Also included in #3541 (splitscreen), whose profile tests damage another player; it drops out of that PR once this one merges. **Vanilla reference:** `DamageCommand.damage` hurts any entity target, players included. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Mac, against upstream/main at 3c63c5913, 7 min 6 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +26 −15 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (23 s) | | rustfmt | ✅ (3 s) | | clippy | ✅ (1 min 2 s) | | tests: horizon-client | ✅ 804 passed (4 min 44 s) | | doc tests | ✅ 0 passed (43 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 31 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 19 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:30 +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#5137
No description provided.