Replace some sound PlayEntity with PlayPvs (#34317)

(cherry picked from commit 7ae7821213b7b3a528649da1772bc9af80c8584e)
This commit is contained in:
Leon Friedrich
2025-01-11 01:44:30 +11:00
committed by Spatison
parent 7ceeb5522e
commit e32c96a3f9
6 changed files with 22 additions and 13 deletions

View File

@@ -367,6 +367,11 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
// + if the bomb is big enough, people outside of it too
// this is capped to 30 because otherwise really huge bombs
// will attempt to play regular audio for people who can't hear it anyway because the epicenter is so far away
//
// TODO EXPLOSION redo this.
// Use the Filter.Pvs range-multiplier option instead of AddInRange.
// Also the default PVS range is 25*2 = 50. So capping it at 30 makes no sense here.
// So actually maybe don't use Filter.Pvs at all and only use AddInRange?
var audioRange = Math.Min(iterationIntensity.Count * 2, MaxExplosionAudioRange);
var filter = Filter.Pvs(pos).AddInRange(pos, audioRange);
var sound = iterationIntensity.Count < queued.Proto.SmallSoundIterationThreshold