Fall back to file name if planet name not defined

This commit is contained in:
xen-42 2024-10-03 00:36:27 -04:00
parent 45ce315bfc
commit 6f4e7cc4b3

View File

@ -3,6 +3,7 @@ using NewHorizons.Utility.Files;
using NewHorizons.Utility.OWML;
using OWML.Common;
using System;
using System.IO;
using System.Linq;
using UnityEngine;
@ -16,6 +17,12 @@ namespace NewHorizons.External
Mod = mod;
RelativePath = relativePath;
// Fall back to file name if name not given
if (!string.IsNullOrEmpty(relativePath) && string.IsNullOrEmpty(config.name))
{
config.name = Path.GetFileNameWithoutExtension(relativePath);
}
Migrate();
}