Content audio (#20862)
This commit is contained in:
@@ -2,6 +2,7 @@ using Content.Server.Nutrition.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Interaction;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
@@ -15,6 +16,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly FoodSystem _foodSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -66,8 +68,8 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
if (_robustRandom.Prob(component.BreakChance))
|
||||
{
|
||||
SoundSystem.Play(component.BreakSound.GetSound(), Filter.Pvs(userUid), userUid, AudioParams.Default.WithVolume(-2f));
|
||||
EntityManager.DeleteEntity(component.Owner);
|
||||
_audio.PlayPvs(component.BreakSound, userUid, AudioParams.Default.WithVolume(-2f));
|
||||
EntityManager.DeleteEntity(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user