Skip to content

Commit

Permalink
Better handle Rakaly "Failed to create melted file" error (#2438) #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Jan 18, 2025
1 parent 3f0a79f commit 13412cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ DocsGenerator/obj/
log.txt
*.user
.vscode/settings.json

# Imperator: Rome saves for testing
/Saves/
7 changes: 2 additions & 5 deletions ImperatorToCK3/Helpers/RakalyCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,8 @@ public static void MeltSave(string savePath) {

if (stdErrText.Contains("Failed to create melted file")) {
// Try to copy the file to the converter's temp folder before melting.
var saveDisk = Path.GetPathRoot(savePath);
var converterDisk = Path.GetPathRoot(Directory.GetCurrentDirectory());

if (saveDisk != converterDisk) {
const string fallbackSavePath = "temp/save_to_be_melted.rome";
const string fallbackSavePath = "temp/save_to_be_melted.rome";
if (savePath != fallbackSavePath) {
File.Copy(savePath, fallbackSavePath, overwrite: true);
MeltSave(fallbackSavePath);
return;
Expand Down

0 comments on commit 13412cb

Please sign in to comment.