From 92352bcf275f8d9996d8156cea9cd058f7c97822 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Thu, 11 Aug 2022 21:19:59 +0200 Subject: [PATCH] Fixed bug with wrong SFX paths Causing ContentPacks to load slower --- P3D/Resources/Sound/SoundManager.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/P3D/Resources/Sound/SoundManager.vb b/P3D/Resources/Sound/SoundManager.vb index 68e8ae326..b6211a6c8 100644 --- a/P3D/Resources/Sound/SoundManager.vb +++ b/P3D/Resources/Sound/SoundManager.vb @@ -114,9 +114,9 @@ End Sub Public Shared Sub LoadSounds(ByVal forceReplace As Boolean) - For Each soundfile As String In System.IO.Directory.GetFiles(GameController.GamePath & "\Content\Sounds\") + For Each soundfile As String In System.IO.Directory.GetFiles(GameController.GamePath & "\Content\Sounds\", "*.*", IO.SearchOption.AllDirectories) If soundfile.EndsWith(".wav") = True Or soundfile.EndsWith(".xnb") = True Then - soundfile = System.IO.Path.GetFileNameWithoutExtension(soundfile) + soundfile = soundfile.Remove(soundfile.Length - 4, 4).Remove(0, (GameController.GamePath & "\Content\Sounds\").Length) AddSound(soundfile, forceReplace) End If Next @@ -127,7 +127,7 @@ If System.IO.Directory.Exists(path) = True Then For Each soundfile As String In System.IO.Directory.GetFiles(path, "*.*", IO.SearchOption.AllDirectories) If soundfile.EndsWith(".wav") = True Or soundfile.EndsWith(".xnb") = True Then - soundfile = System.IO.Path.GetFileNameWithoutExtension(soundfile) + soundfile = soundfile.Remove(soundfile.Length - 4, 4).Remove(0, path.Length) AddSound(soundfile, forceReplace) End If Next