From 523280e781e35f4d86f68852a3f125baf8f30c8f Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 09:07:42 +0100 Subject: [PATCH] Draw the new level-event sound pitches from the client level's random LevelEventHandler plays 1501, 1502, 1046 and 1047 with ClientLevel.getRandom(), not the server level's random: drawing them from the world's random moved the level random in use_item_on's respawn anchor cases (12 of 4000 differed). Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 23e28eab7..ac567483a 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -3112,12 +3112,19 @@ impl Game<'_> { }; if let Some((name, volume)) = sound { let pitch = match id { - 1009 | 1501 | 1502 => { + 1009 => { 2.6 + (self.world.random.next_float() - self.world.random.next_float()) * 0.8 } - 1029 | 1030 | 1042 | 1043 | 1044 | 1046 | 1047 | 1053 | 1054 => { + // LevelEventHandler draws these from the client + // level's random, before 1501's and 1502's smoke. + 1501 | 1502 => { + let r = self.particles.level_random(); + 2.6 + (r.next_float() - r.next_float()) * 0.8 + } + 1046 | 1047 => self.particles.level_random().next_float() * 0.1 + 0.9, + 1029 | 1030 | 1042 | 1043 | 1044 | 1053 | 1054 => { self.world.random.next_float() * 0.1 + 0.9 } 1019 | 1021 => {