Skip to content

Commit

Permalink
Fix sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
vaketola committed Jan 19, 2024
1 parent d74544f commit d526351
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Content.Server/CosmaticDrift/CryoSleep/CryoSleepSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
using Content.Shared.Roles.Jobs;
using Content.Shared.StationRecords;
using Content.Shared.Verbs;
using Robust.Server.Audio;
using Robust.Server.Containers;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Enums;
using Robust.Shared.Player;
using Robust.Shared.Physics;

namespace Content.Server.CryoSleep;

Expand All @@ -43,6 +45,8 @@ public sealed class CryoSleepSystem : EntitySystem
[Dependency] private readonly StationRecordsSystem _stationRecords = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly EntityStorageSystem _entityStorage = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;


public override void Initialize()
{
Expand Down Expand Up @@ -75,7 +79,7 @@ private bool InsertBody(EntityUid uid, EntityUid? toInsert, CryoSleepComponent c
public bool RespawnUser(EntityUid? toInsert, CryoSleepComponent component, bool force)
{
// Play the cryosleep pod opening sound effect.
SoundSystem.Play("/Audio/SimpleStation14/Effects/cryosleepopen.ogg", Filter.Pvs(component.Owner), component.Owner, AudioParams.Default.WithVolume(5f));
_audioSystem.PlayPvs("/Audio/SimpleStation14/Effects/cryosleepopen.ogg", component.Owner, AudioParams.Default.WithVolume(5f));

if (toInsert == null)
return false;
Expand Down Expand Up @@ -118,8 +122,8 @@ public void CryoStoreBody(EntityUid mindId)
if (body == null)
return;

// Play the cryostasis sound effect.
SoundSystem.Play("/Audio/SimpleStation14/Effects/cryostasis.ogg", Filter.Pvs(body.Value), body.Value, AudioParams.Default.WithVolume(5f));
// Play the cryostasis sound effect. Need to use coordinates since the body gets deleted.
_audioSystem.PlayPvs("/Audio/SimpleStation14/Effects/cryostasis.ogg", Transform(body.Value).Coordinates, AudioParams.Default.WithVolume(5f));

// Remove the record. Hopefully.
foreach (var item in _inventory.GetHandOrInventoryEntities(body.Value))
Expand Down

0 comments on commit d526351

Please sign in to comment.