[PR #2522] [MERGED] Play the level-up sound for each level a gain crosses #4392

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

📋 Pull Request Information

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

Base: main ← Head: fix/level-up-sound


📝 Commits (1)

  • 7fdd57a Play the level-up sound for each level a gain crosses

📊 Changes

2 files changed (+12 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+8 -4)
📝 crates/horizon-client/src/game.rs (+4 -7)

📄 Description

What and why

The level-up sound was only tested against the level the player ended on. Vanilla calls giveExperienceLevels(1) once per level gained, so a gain that crosses level 5 (or 10, ...) plays the sound even when it ends on another level, with the volume of the level it crossed. Experience::give now returns the first multiple of 5 it reached and give_orb_points plays the sound for that level, still behind the 100 tick cooldown (which in vanilla also keeps the later levels of the same gain quiet).

Vanilla reference

  • Player.giveExperiencePoints (loop calling giveExperienceLevels(1))
  • Player.giveExperienceLevels (experienceLevel % 5 == 0, lastLevelUpTime < tickCount - 100, volume level / 30 capped at 1, times 0.75)

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/2522 **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/level-up-sound` --- ### 📝 Commits (1) - [`7fdd57a`](https://github.com/horizon-rust/horizon/commit/7fdd57ad1ef559706e0ebf445aa7f49323c635b9) Play the level-up sound for each level a gain crosses ### 📊 Changes **2 files changed** (+12 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+8 -4) 📝 `crates/horizon-client/src/game.rs` (+4 -7) </details> ### 📄 Description ## What and why The level-up sound was only tested against the level the player ended on. Vanilla calls `giveExperienceLevels(1)` once per level gained, so a gain that crosses level 5 (or 10, ...) plays the sound even when it ends on another level, with the volume of the level it crossed. `Experience::give` now returns the first multiple of 5 it reached and `give_orb_points` plays the sound for that level, still behind the 100 tick cooldown (which in vanilla also keeps the later levels of the same gain quiet). ## Vanilla reference - `Player.giveExperiencePoints` (loop calling `giveExperienceLevels(1)`) - `Player.giveExperienceLevels` (`experienceLevel % 5 == 0`, `lastLevelUpTime < tickCount - 100`, volume `level / 30` capped at 1, times 0.75) ## 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:49 +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#4392
No description provided.