问题修复
This commit is contained in:
@@ -244,15 +244,22 @@ namespace AibisDream
|
||||
|
||||
private void DeleteOldSave()
|
||||
{
|
||||
var fileList = Directory.GetFiles(ConstRef.SaveFilePath);
|
||||
if (fileList.Length > MaxSaveNum)
|
||||
if (Directory.Exists(ConstRef.SaveFilePath))
|
||||
{
|
||||
var sorted = fileList.OrderByDescending(f => f).ToArray();
|
||||
for (var i = MaxSaveNum; i < fileList.Length; i++)
|
||||
var fileList = Directory.GetFiles(ConstRef.SaveFilePath);
|
||||
if (fileList.Length > MaxSaveNum)
|
||||
{
|
||||
File.Delete(sorted[i]);
|
||||
var sorted = fileList.OrderByDescending(f => f).ToArray();
|
||||
for (var i = MaxSaveNum; i < fileList.Length; i++)
|
||||
{
|
||||
File.Delete(sorted[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Directory.CreateDirectory(ConstRef.SaveFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
public void Load(string savePath)
|
||||
@@ -277,6 +284,8 @@ namespace AibisDream
|
||||
|
||||
private string GetSavePath()
|
||||
{
|
||||
Directory.CreateDirectory(ConstRef.SaveFilePath);
|
||||
|
||||
string gameStage;
|
||||
if (TryGetValue("$gameStage", out float gameStageFloat))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user