From a5725aec4ce28fcf6442d3a6168bbc24cc54879e Mon Sep 17 00:00:00 2001 From: Clyybber Date: Thu, 28 May 2020 00:58:34 +0200 Subject: [PATCH] Pass CollisionMask to the sound systems (#968) --- .../GameObjects/Components/Instruments/InstrumentComponent.cs | 2 ++ Content.Client/GameObjects/Components/Sound/SoundComponent.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs b/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs index bcceead7b9..db315ef920 100644 --- a/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs +++ b/Content.Client/GameObjects/Components/Instruments/InstrumentComponent.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using Content.Shared.GameObjects.Components.Instruments; +using Content.Shared.Physics; using JetBrains.Annotations; using NFluidsynth; using Robust.Shared.GameObjects; @@ -110,6 +111,7 @@ namespace Content.Client.GameObjects.Components.Instruments if (IsRendererAlive) return; + _midiManager.OcclusionCollisionMask = (int) CollisionGroup.Impassable; _renderer = _midiManager.GetNewRenderer(); if (_renderer != null) diff --git a/Content.Client/GameObjects/Components/Sound/SoundComponent.cs b/Content.Client/GameObjects/Components/Sound/SoundComponent.cs index 94bfcf22ff..e530765def 100644 --- a/Content.Client/GameObjects/Components/Sound/SoundComponent.cs +++ b/Content.Client/GameObjects/Components/Sound/SoundComponent.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Content.Shared.GameObjects.Components.Sound; +using Content.Shared.Physics; using Robust.Client.GameObjects.EntitySystems; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Systems; @@ -89,7 +90,7 @@ namespace Content.Client.GameObjects.Components.Sound public override void Initialize() { base.Initialize(); - EntitySystem.TryGet(out _audioSystem); + if (EntitySystem.TryGet(out _audioSystem)) _audioSystem.OcclusionCollisionMask = (int) CollisionGroup.Impassable; } public override void ExposeData(ObjectSerializer serializer)