From 71fe1e4cd8c3aa6f7b04b884ac438a4855ca67f4 Mon Sep 17 00:00:00 2001 From: MattNL Date: Wed, 10 May 2023 07:17:17 -0400 Subject: [PATCH] Fix for crash when organizing binka files --- PCK-Studio/Forms/Editor/AudioEditor.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/Forms/Editor/AudioEditor.cs b/PCK-Studio/Forms/Editor/AudioEditor.cs index 6cc90670..53650f1e 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.cs @@ -612,12 +612,14 @@ namespace PckStudio.Forms.Editor { string song = category.SongNames[i]; string songpath = Path.Combine(parent.GetDataPath(), song + ".binka"); - if (File.Exists(songpath)) + string new_path = Path.Combine(musicdir, Path.GetFileName(song) + ".binka"); + if (File.Exists(songpath) && !File.Exists(new_path)) { - File.Move(songpath, Path.Combine(musicdir, song + ".binka")); - } + File.Move(songpath, new_path); - category.SongNames[i] = Path.Combine("Music", song.Replace(song, Path.GetFileNameWithoutExtension(songpath))); + // Songs with a backslash instead of a forward slash were not playing in RPCS3 + category.SongNames[i] = "Music/" + song.Replace(song, Path.GetFileNameWithoutExtension(songpath)); + } } } treeView2.Nodes.Clear();