Skip to content

Commit 13412cb

Browse files
authored
Better handle Rakaly "Failed to create melted file" error (#2438) #patch
1 parent 3f0a79f commit 13412cb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ DocsGenerator/obj/
3434
log.txt
3535
*.user
3636
.vscode/settings.json
37+
38+
# Imperator: Rome saves for testing
39+
/Saves/

ImperatorToCK3/Helpers/RakalyCaller.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,8 @@ public static void MeltSave(string savePath) {
120120

121121
if (stdErrText.Contains("Failed to create melted file")) {
122122
// Try to copy the file to the converter's temp folder before melting.
123-
var saveDisk = Path.GetPathRoot(savePath);
124-
var converterDisk = Path.GetPathRoot(Directory.GetCurrentDirectory());
125-
126-
if (saveDisk != converterDisk) {
127-
const string fallbackSavePath = "temp/save_to_be_melted.rome";
123+
const string fallbackSavePath = "temp/save_to_be_melted.rome";
124+
if (savePath != fallbackSavePath) {
128125
File.Copy(savePath, fallbackSavePath, overwrite: true);
129126
MeltSave(fallbackSavePath);
130127
return;

0 commit comments

Comments
 (0)