From 855891704dc8a614e8e7c9a32c9ca0e1bc8b4cab Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 9 Jan 2018 12:16:17 +0200 Subject: [PATCH] Reverted sound loading changes in 2cb0ee73. I don't think sharing the same Sound objects is necessary, because Sounds using the same audio clip already share the same OggSound object which holds the actual audio data. Also I think these changes would cause removing a sound to break other sounds sharing the same audio clip. --- Barotrauma/BarotraumaClient/Source/Sounds/Sound.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Sounds/Sound.cs b/Barotrauma/BarotraumaClient/Source/Sounds/Sound.cs index 34ebeb3d3..c1dd80996 100644 --- a/Barotrauma/BarotraumaClient/Source/Sounds/Sound.cs +++ b/Barotrauma/BarotraumaClient/Source/Sounds/Sound.cs @@ -87,10 +87,6 @@ namespace Barotrauma DebugConsole.ThrowError("File \"" + file + "\" not found!"); return null; } - - Sound dupe = Sound.loadedSounds.Find(s => s.filePath == file); - if (dupe != null) - return dupe; return new Sound(file, destroyOnGameEnd); } @@ -104,9 +100,6 @@ namespace Barotrauma { newSound.baseVolume = element.GetAttributeFloat("volume", 1.0f); newSound.range = element.GetAttributeFloat("range", 1000.0f); - Sound dupe = Sound.loadedSounds.Find(s => s.filePath == filePath && s.baseVolume == newSound.baseVolume && s.range == newSound.range); - if (dupe != null) - return dupe; } return newSound;