Content audio (#20862)

This commit is contained in:
metalgearsloth
2023-10-29 14:58:23 +11:00
committed by GitHub
parent cd280eef6b
commit 9b1b3e03ed
326 changed files with 890 additions and 436 deletions

View File

@@ -10,6 +10,8 @@ using Content.Shared.Mech.Equipment.Components;
using Content.Shared.Mobs.Components;
using Content.Shared.Wall;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Physics;
@@ -149,7 +151,7 @@ public sealed class MechGrabberSystem : EntitySystem
return;
args.Handled = true;
component.AudioStream = _audio.PlayPvs(component.GrabSound, uid);
component.AudioStream = _audio.PlayPvs(component.GrabSound, uid).Value.Entity;
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.GrabDelay, new GrabberDoAfterEvent(), uid, target: target, used: uid)
{
BreakOnTargetMove = true,
@@ -161,7 +163,7 @@ public sealed class MechGrabberSystem : EntitySystem
{
if (args.Cancelled)
{
component.AudioStream?.Stop();
component.AudioStream = _audio.Stop(component.AudioStream);
return;
}