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

@@ -237,7 +237,7 @@ public sealed class NukeSystem : EntitySystem
private void OnClearButtonPressed(EntityUid uid, NukeComponent component, NukeKeypadClearMessage args)
{
_audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true);
_audio.PlayPvs(component.KeypadPressSound, uid);
if (component.Status != NukeStatus.AWAIT_CODE)
return;
@@ -353,12 +353,12 @@ public sealed class NukeSystem : EntitySystem
{
component.Status = NukeStatus.AWAIT_ARM;
component.RemainingTime = component.Timer;
_audio.PlayEntity(component.AccessGrantedSound, Filter.Pvs(uid), uid, true);
_audio.PlayPvs(component.AccessGrantedSound, uid);
}
else
{
component.EnteredCode = "";
_audio.PlayEntity(component.AccessDeniedSound, Filter.Pvs(uid), uid, true);
_audio.PlayPvs(component.AccessDeniedSound, uid);
}
break;
@@ -427,7 +427,9 @@ public sealed class NukeSystem : EntitySystem
// Don't double-dip on the octave shifting
component.LastPlayedKeypadSemitones = number == 0 ? component.LastPlayedKeypadSemitones : semitoneShift;
_audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f));
var opts = component.KeypadPressSound.Params;
opts = AudioHelpers.ShiftSemitone(opts, semitoneShift).AddVolume(-5f);
_audio.PlayPvs(component.KeypadPressSound, uid, opts);
}
public string GenerateRandomNumberString(int length)