Skip to content

Commit 3324175

Browse files
committed
Fix ResoniteMod.HandleIncompatibleConfigurationVersions being ignored by ML
Pointed out in connection to resonite-modding-group/ResoniteModLoader#41
1 parent a48fef5 commit 3324175

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

MonkeyLoader.GamePacks.ResoniteModLoader/ModConfiguration.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ public enum IncompatibleConfigurationHandlingOption
4242
/// <summary>
4343
/// Fail to read the config, and block saving over the config on disk.
4444
/// </summary>
45-
ERROR,
45+
ERROR = IncompatibleConfigHandling.Error,
4646

4747
/// <summary>
4848
/// Destroy the saved config and start over from scratch.
4949
/// </summary>
50-
CLOBBER,
50+
CLOBBER = IncompatibleConfigHandling.Clobber,
5151

5252
/// <summary>
5353
/// Ignore the version number and attempt to load the config from disk.
5454
/// </summary>
55-
FORCELOAD,
55+
FORCELOAD = IncompatibleConfigHandling.ForceLoad,
5656
}
5757

5858
/// <summary>
@@ -82,6 +82,15 @@ internal ModConfiguration(ModConfigurationDefinition definition)
8282
_definition = definition;
8383
}
8484

85+
/// <inheritdoc/>
86+
protected override IncompatibleConfigHandling HandleIncompatibleVersions(Version serializedVersion)
87+
{
88+
if (Owner is ResoniteMod resoniteMod)
89+
return (IncompatibleConfigHandling)resoniteMod.HandleIncompatibleConfigurationVersions(serializedVersion, Version);
90+
91+
return base.HandleIncompatibleVersions(serializedVersion);
92+
}
93+
8594
/// <summary>
8695
/// Get a value, throwing a <see cref="KeyNotFoundException"/> if the key is not found.
8796
/// </summary>

0 commit comments

Comments
 (0)