[PR #2235] [MERGED] Round instant potion effects and measure splash range from the body #4128

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

📋 Pull Request Information

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

Base: main ← Head: fix/instant-effects-rounding-splash-distance


📝 Commits (5)

  • d2105fe Round instant potion effects and measure splash range from the body
  • c35436a Merge main into fix/instant-effects-rounding-splash-distance
  • 3ec5217 Merge origin/main into fix/instant-effects-rounding-splash-distance
  • 0cecbef Merge origin/main into fix/instant-effects-rounding-splash-distance
  • e6b9299 Merge origin/main into fix/instant-effects-rounding-splash-distance

📊 Changes

2 files changed (+48 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/effects.rs (+4 -3)
📝 crates/horizon-client/src/game/potions.rs (+44 -19)

📄 Description

What and why

Two small differences in how instant potion effects landed:

  • Instant Health and Instant Damage truncated the scaled amount. Vanilla rounds to the nearest point ((int)(scale * (4 << amp) + 0.5), and 6 for harm). A splash at 60% strength on Instant Damage I now deals 4 instead of 3. This also applies to mobs hit by a splash.
  • A splash potion used the distance to the centre of a mob or player. Vanilla uses the distance from the potion's own box to the entity's box grown by the hit margin, and only looks at entities that touch the potion's box grown by (4, 2, 4). The splash now follows that, for the player, LAN guests (same code path) and mobs.

Vanilla reference

  • HealOrHarmMobEffect.applyInstantaneousEffect
  • ThrownSplashPotion.onHitAsPotion (potion box, inflate(4, 2, 4), distanceToSqr(box.inflate(margin)))
  • ProjectileUtil.computeMargin, AABB.distanceToSqr(AABB)

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/2235 **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/instant-effects-rounding-splash-distance` --- ### 📝 Commits (5) - [`d2105fe`](https://github.com/horizon-rust/horizon/commit/d2105fe66c17fa41a5efe66a5217dd5ef7e94c1f) Round instant potion effects and measure splash range from the body - [`c35436a`](https://github.com/horizon-rust/horizon/commit/c35436a7daa054a7480ce5c0bf30ecfe850fbec7) Merge main into fix/instant-effects-rounding-splash-distance - [`3ec5217`](https://github.com/horizon-rust/horizon/commit/3ec521749b5c99c88b48ad0624e9534da944b9fa) Merge origin/main into fix/instant-effects-rounding-splash-distance - [`0cecbef`](https://github.com/horizon-rust/horizon/commit/0cecbef5c321f1f0fe5b33b5f4a32aed38ad2bd8) Merge origin/main into fix/instant-effects-rounding-splash-distance - [`e6b9299`](https://github.com/horizon-rust/horizon/commit/e6b92995f3907c621522f208a4d0e41081aa43d7) Merge origin/main into fix/instant-effects-rounding-splash-distance ### 📊 Changes **2 files changed** (+48 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/effects.rs` (+4 -3) 📝 `crates/horizon-client/src/game/potions.rs` (+44 -19) </details> ### 📄 Description ## What and why Two small differences in how instant potion effects landed: - Instant Health and Instant Damage truncated the scaled amount. Vanilla rounds to the nearest point (`(int)(scale * (4 << amp) + 0.5)`, and 6 for harm). A splash at 60% strength on Instant Damage I now deals 4 instead of 3. This also applies to mobs hit by a splash. - A splash potion used the distance to the centre of a mob or player. Vanilla uses the distance from the potion's own box to the entity's box grown by the hit margin, and only looks at entities that touch the potion's box grown by (4, 2, 4). The splash now follows that, for the player, LAN guests (same code path) and mobs. ## Vanilla reference - `HealOrHarmMobEffect.applyInstantaneousEffect` - `ThrownSplashPotion.onHitAsPotion` (potion box, `inflate(4, 2, 4)`, `distanceToSqr(box.inflate(margin))`) - `ProjectileUtil.computeMargin`, `AABB.distanceToSqr(AABB)` ## 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:14:52 +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#4128
No description provided.