From 1ec18155a375dad1f71b71d21f5c429cd63ea05b Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:12:01 +0300 Subject: [PATCH] fix: sound --- .../Item/ItemToggle/SharedItemToggleSystem.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs b/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs index 39f38ba90c..84ef3f8ca6 100644 --- a/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs +++ b/Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs @@ -169,11 +169,11 @@ private void Activate(EntityUid uid, ItemToggleComponent itemToggle, bool predic /// private void Deactivate(EntityUid uid, ItemToggleComponent itemToggle, bool predicted, EntityUid? user = null) { + if (_netManager.IsClient) // WD EDIT + return; + var soundToPlay = itemToggle.SoundDeactivate; - if (predicted) - _audio.PlayPredicted(soundToPlay, uid, user); - else - _audio.PlayPvs(soundToPlay, uid); + _audio.PlayPvs(soundToPlay, uid); // END FIX HARDCODING var toggleUsed = new ItemToggledEvent(predicted, Activated: false, user); @@ -247,10 +247,7 @@ private void UpdateActiveSound(EntityUid uid, ItemToggleActiveSoundComponent act { if (activeSound.ActiveSound != null && activeSound.PlayingStream == null) { - if (args.Predicted) - activeSound.PlayingStream = _audio.PlayPredicted(activeSound.ActiveSound, uid, args.User, AudioParams.Default.WithLoop(true)).Value.Entity; - else - activeSound.PlayingStream = _audio.PlayPvs(activeSound.ActiveSound, uid, AudioParams.Default.WithLoop(true)).Value.Entity; + activeSound.PlayingStream = _audio.PlayPvs(activeSound.ActiveSound, uid, AudioParams.Default.WithLoop(true)).Value.Entity; } } else