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 <noreply@anthropic.com>
This commit is contained in:
@@ -3112,12 +3112,19 @@ impl Game<'_> {
|
|||||||
};
|
};
|
||||||
if let Some((name, volume)) = sound {
|
if let Some((name, volume)) = sound {
|
||||||
let pitch = match id {
|
let pitch = match id {
|
||||||
1009 | 1501 | 1502 => {
|
1009 => {
|
||||||
2.6 + (self.world.random.next_float()
|
2.6 + (self.world.random.next_float()
|
||||||
- self.world.random.next_float())
|
- self.world.random.next_float())
|
||||||
* 0.8
|
* 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
|
self.world.random.next_float() * 0.1 + 0.9
|
||||||
}
|
}
|
||||||
1019 | 1021 => {
|
1019 | 1021 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user