fix LuaCsUpdateChecker throwing fatal error when having a missing file
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -50,8 +50,16 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
foreach (string file in filesToUpdate)
|
foreach (string file in filesToUpdate)
|
||||||
{
|
{
|
||||||
File.Move(file, file + ".todelete", true);
|
try
|
||||||
File.Copy(Path.Combine(luaCsPath, "Binary", file), file, true);
|
{
|
||||||
|
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);
|
File.WriteAllText(LuaCsSetup.VersionFile, workshopVersion);
|
||||||
@@ -78,4 +86,4 @@ namespace Barotrauma
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user