mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fall back to file name if planet name not defined
This commit is contained in:
parent
45ce315bfc
commit
6f4e7cc4b3
7
NewHorizons/External/NewHorizonBody.cs
vendored
7
NewHorizons/External/NewHorizonBody.cs
vendored
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user