From 13412cb4046b81b0000cbbdbd28220038245aee0 Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Sat, 18 Jan 2025 22:14:33 +0100 Subject: [PATCH] Better handle Rakaly "Failed to create melted file" error (#2438) #patch --- .gitignore | 3 +++ ImperatorToCK3/Helpers/RakalyCaller.cs | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3fdeb30c5..ac9a0e8d9 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ DocsGenerator/obj/ log.txt *.user .vscode/settings.json + +# Imperator: Rome saves for testing +/Saves/ diff --git a/ImperatorToCK3/Helpers/RakalyCaller.cs b/ImperatorToCK3/Helpers/RakalyCaller.cs index 7db566149..b711c1c10 100644 --- a/ImperatorToCK3/Helpers/RakalyCaller.cs +++ b/ImperatorToCK3/Helpers/RakalyCaller.cs @@ -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;