Backwards compat for certain mods broken by keepLoaded = false

This commit is contained in:
Nick 2022-09-30 22:24:54 -04:00
parent b5f5a4cabc
commit 6f55b8da3f

View File

@ -1,5 +1,6 @@
using NewHorizons.External.Configs;
using NewHorizons.External.Configs;
using OWML.Common;
using System.Linq;
using UnityEngine;
namespace NewHorizons.Utility
{
@ -17,5 +18,31 @@ namespace NewHorizons.Utility
public string RelativePath;
public GameObject Object;
#region Migration
private static readonly string[] _keepLoadedModsList = new string[]
{
"CreativeNameTxt.theirhomeworld",
"Roggsy.enterthewarioverse",
"Jammer.jammerlore",
"ErroneousCreationist.solarneighbourhood",
"ErroneousCreationist.incursionfinaldawn"
};
private void Migrate()
{
// Some old mods get really broken by this change in 1.6.1
if (_keepLoadedModsList.Contains(Mod.ModHelper.Manifest.UniqueName))
{
if (Config?.Props?.details != null)
{
foreach (var detail in Config.Props.details)
{
detail.keepLoaded = true;
}
}
}
}
#region Migration
}
}