fix LuaCsUpdateChecker throwing fatal error when having a missing file

This commit is contained in:
EvilFactory
2022-08-20 19:43:47 -03:00
parent f19228f366
commit 199d9b78f0

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
@@ -50,8 +50,16 @@ namespace Barotrauma
{
foreach (string file in filesToUpdate)
{
File.Move(file, file + ".todelete", true);
File.Copy(Path.Combine(luaCsPath, "Binary", file), file, true);
try
{
File.Move(file, file + ".todelete", true);
File.Copy(Path.Combine(luaCsPath, "Binary", file), file, true);
}
catch (Exception e)
{
DebugConsole.ThrowError($"Failed to update file {e}");
}
}
File.WriteAllText(LuaCsSetup.VersionFile, workshopVersion);
@@ -78,4 +86,4 @@ namespace Barotrauma
}
}
}
}