Audio System Rejig (#9635)
This commit is contained in:
@@ -3,16 +3,15 @@ using Content.Server.Interaction.Components;
|
||||
using Content.Server.Sound.Components;
|
||||
using Content.Server.Throwing;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Throwing;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
using Content.Server.Popups;
|
||||
|
||||
namespace Content.Server.Sound
|
||||
{
|
||||
@@ -23,8 +22,9 @@ namespace Content.Server.Sound
|
||||
public sealed class EmitSoundSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -108,8 +108,7 @@ namespace Content.Server.Sound
|
||||
|
||||
private void TryEmitSound(BaseEmitSoundComponent component)
|
||||
{
|
||||
var audioParams = component.AudioParams.WithPitchScale((float) _random.NextGaussian(1, component.PitchVariation));
|
||||
SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), component.Owner, audioParams);
|
||||
_audioSystem.PlayPvs(component.Sound, component.Owner, component.Sound.Params.AddVolume(-2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user