Fixed bug with wrong SFX paths

Causing ContentPacks to load slower
This commit is contained in:
JappaWakka 2022-08-11 21:19:59 +02:00
parent 5609143300
commit 92352bcf27
1 changed files with 3 additions and 3 deletions
P3D/Resources/Sound

View File

@ -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