From c80fb97bc9b354c7b9e04d36f9a8b1364ca39dd7 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 10 May 2015 20:04:27 +0000 Subject: [PATCH] MultiDiskBundler - fix exception on load when the current rom is in an archive --- .../tools/MultiDiskBundler/MultiDiskBundler.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs b/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs index 257cb4c868..0db475c1e5 100644 --- a/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs +++ b/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs @@ -27,7 +27,20 @@ namespace BizHawk.Client.EmuHawk { if (!Global.Game.IsNullInstance) { - NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml"); + string currentRom = GlobalWin.MainForm.CurrentlyOpenRom; + if (GlobalWin.MainForm.CurrentlyOpenRom.Contains("|")) + { + var pieces = GlobalWin.MainForm.CurrentlyOpenRom.Split('|'); + + var directory = Path.GetDirectoryName(pieces[0]); + var filename = Path.ChangeExtension(pieces[1], ".xml"); + + NameBox.Text = Path.Combine(directory, filename); + } + else + { + NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml"); + } } AddButton_Click(null, null);