Skip to content

Commit afc0cb7

Browse files
committed
Fix Mod Settings throwing error on initialization when mod instances don't match.
1 parent 7506d42 commit afc0cb7

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

Source/Mod/Mod.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,6 @@ private bool Initialize()
126126
return this.instance.InitModCode();
127127
}
128128

129-
public bool DoesModInstanceMatch(global::Mod mod)
130-
{
131-
if (!this.Loaded)
132-
return false;
133-
134-
return this.instance == mod;
135-
}
136-
137129
protected string GetModFolderPath(string subpath)
138130
{
139131
return $"@modfolder({this.Info.Name}):{subpath}";

Source/Mod/ModLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public bool IsModEnabled(Mod mod)
115115

116116
public Mod GetModFromInstance(global::Mod instance)
117117
{
118-
return this.GetMods(true).Find(mod => mod.DoesModInstanceMatch(instance));
118+
return this.GetMods(true).Find(mod => mod.Info.Name.Equals(instance.Name));
119119
}
120120

121121
public bool SaveModChanges()

Source/Settings/ModManagerModSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class ModManagerModSettings : IModSettings
2222
public ModManagerModSettings(global::Mod mod)
2323
{
2424
this.entry = ModLoader.Instance.GetModFromInstance(mod);
25+
2526
loadedSettingsInstance = loadedSettings.ContainsKey(this.entry.Info.Name) ? loadedSettings[this.entry.Info.Name] : new Dictionary<string, string>();
2627

2728
modSettingsInstances.Add(entry, this);

0 commit comments

Comments
 (0)