Replace some sound PlayEntity with PlayPvs (#34317)

This commit is contained in:
Leon Friedrich
2025-01-11 01:44:30 +11:00
committed by GitHub
parent dff9abfe74
commit 7ae7821213
6 changed files with 22 additions and 13 deletions

View File

@@ -235,7 +235,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;
@@ -351,12 +351,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;
@@ -425,7 +425,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)