From 7186a8010abf1100c973f938e8970fa725008134 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 24 Aug 2017 19:52:04 +0300 Subject: [PATCH] Fixed item pickup sounds playing during loading --- Barotrauma/BarotraumaClient/Source/GameMain.cs | 5 +++++ .../Source/Items/Components/Holdable/Pickable.cs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameMain.cs b/Barotrauma/BarotraumaClient/Source/GameMain.cs index ed0f3f3b6..a31dc8cf6 100644 --- a/Barotrauma/BarotraumaClient/Source/GameMain.cs +++ b/Barotrauma/BarotraumaClient/Source/GameMain.cs @@ -102,6 +102,11 @@ namespace Barotrauma get; private set; } + + public bool LoadingScreenOpen + { + get { return loadingScreenOpen; } + } public GameMain() { diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Pickable.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Pickable.cs index 2f1e0a9ed..7925cacda 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Pickable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Pickable.cs @@ -88,14 +88,14 @@ namespace Barotrauma.Items.Components ApplyStatusEffects(ActionType.OnPicked, 1.0f, picker); #if CLIENT - GUI.PlayUISound(GUISoundType.PickItem); + if (!GameMain.Instance.LoadingScreenOpen) GUI.PlayUISound(GUISoundType.PickItem); #endif return true; } #if CLIENT - GUI.PlayUISound(GUISoundType.PickItemFail); + if (!GameMain.Instance.LoadingScreenOpen) GUI.PlayUISound(GUISoundType.PickItemFail); #endif return false;