备份功能删除了错误的最新存档

Fix #228
This commit is contained in:
ZouJin 2023-09-23 00:37:23 +08:00
parent d808b5cb17
commit 5d3a6e0d56
2 changed files with 3 additions and 2 deletions

View File

@ -195,7 +195,7 @@ namespace VPet_Simulator.Windows
{
var ds = new List<string>(Directory.GetFiles(ExtensionValue.BaseDirectory + @"\BackUP", "*.lps")).FindAll(x => x.Contains('_')).OrderBy(x =>
{
if (int.TryParse(x.Split('_')[1], out int i))
if (int.TryParse(x.Split('_')[1].Split('.')[0], out int i))
return i;
return 0;
}).ToList();
@ -622,6 +622,7 @@ namespace VPet_Simulator.Windows
return false;
GameSavesData = tmp;
Core.Save = tmp.GameSave;
HashCheck = HashCheck;
return true;
}
private void Handle_Steam(Main obj)

View File

@ -262,7 +262,7 @@ namespace VPet_Simulator.Windows
{
var ds = new List<string>(Directory.GetFiles(ExtensionValue.BaseDirectory + @"\BackUP", "*.lps")).FindAll(x => x.Contains('_')).OrderBy(x =>
{
if (int.TryParse(x.Split('_')[1], out int i))
if (int.TryParse(x.Split('_')[1].Split('.')[0], out int i))
return i;
return 0;
}).ToList();