From 2629d47dcb5b1d7dbb4b116dfde73eefbeb7f203 Mon Sep 17 00:00:00 2001 From: Bussun Date: Mon, 6 Dec 2021 09:39:53 +0100 Subject: [PATCH] Creates a backup when opening In case of corruption --- BMGEditor/UI/BMGEditForm.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BMGEditor/UI/BMGEditForm.cs b/BMGEditor/UI/BMGEditForm.cs index 2a639eb..59444f3 100644 --- a/BMGEditor/UI/BMGEditForm.cs +++ b/BMGEditor/UI/BMGEditForm.cs @@ -1,4 +1,5 @@ using BMGEditor.UI; +using System.IO; using System; using System.Windows.Forms; @@ -93,6 +94,7 @@ namespace BMGEditor if (openARCDialog.ShowDialog() == DialogResult.OK) { fileName = openARCDialog.FileName; + File.Copy(fileName, fileName + ".backup", true); m_ARC = new RarcFilesystem(new ExternalFile(fileName, false)); if (m_ARC.FileExists($"{m_ARC.rootName}/message.bmg") && m_ARC.FileExists($"{m_ARC.rootName}/messageid.tbl")) {