From af4985878683942b3f3bf8ecd20206915d5f7db7 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Wed, 4 Oct 2023 19:53:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsteam=E4=BA=91=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=96=87=E4=BB=B6=E5=AF=BC=E8=87=B4=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=90=AF=E5=8A=A8=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.xaml.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 9df7c80..4dfa6d9 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -287,10 +287,14 @@ namespace VPet_Simulator.Windows return i; return 0; }).ToList(); - int.TryParse(ds.Last().Split('_')[1].Split('.')[0], out int lastid); - if (Set.SaveTimes < lastid) + + if (ds.Count != 0) { - Set.SaveTimes = lastid; + int.TryParse(ds.Last().Split('_')[1].Split('.')[0], out int lastid); + if (Set.SaveTimes < lastid) + { + Set.SaveTimes = lastid; + } } for (int i = ds.Count - 1; i >= 0; i--) {