From c402f47d9e8723ae6f14ed4ea3cf1075af6f54fd Mon Sep 17 00:00:00 2001 From: SweptWasTaken Date: Thu, 22 Apr 2021 17:10:16 -0700 Subject: [PATCH] QOL for AirlockVisualizer.cs --- .../Components/Doors/AirlockVisualizer.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Content.Client/GameObjects/Components/Doors/AirlockVisualizer.cs b/Content.Client/GameObjects/Components/Doors/AirlockVisualizer.cs index baffdd0c9c..4c7836179f 100644 --- a/Content.Client/GameObjects/Components/Doors/AirlockVisualizer.cs +++ b/Content.Client/GameObjects/Components/Doors/AirlockVisualizer.cs @@ -53,7 +53,11 @@ namespace Content.Client.GameObjects.Components.Doors var sound = new AnimationTrackPlaySound(); CloseAnimation.AnimationTracks.Add(sound); - sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_closeSound, 0)); + + if (_closeSound != null) + { + sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_closeSound, 0)); + } } OpenAnimation = new Animation {Length = TimeSpan.FromSeconds(_delay)}; @@ -75,7 +79,11 @@ namespace Content.Client.GameObjects.Components.Doors var sound = new AnimationTrackPlaySound(); OpenAnimation.AnimationTracks.Add(sound); - sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_openSound, 0)); + + if (_openSound != null) + { + sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_openSound, 0)); + } } DenyAnimation = new Animation {Length = TimeSpan.FromSeconds(0.3f)}; @@ -87,7 +95,11 @@ namespace Content.Client.GameObjects.Components.Doors var sound = new AnimationTrackPlaySound(); DenyAnimation.AnimationTracks.Add(sound); - sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_denySound, 0, () => AudioHelpers.WithVariation(0.05f))); + + if (_denySound != null) + { + sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_denySound, 0, () => AudioHelpers.WithVariation(0.05f))); + } } }