Skip to content

Commit

Permalink
fix: sound
Browse files Browse the repository at this point in the history
  • Loading branch information
Spatison committed Aug 30, 2024
1 parent 75c3169 commit 1ec1815
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Content.Shared/Item/ItemToggle/SharedItemToggleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ private void Activate(EntityUid uid, ItemToggleComponent itemToggle, bool predic
/// </summary>
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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1ec1815

Please sign in to comment.