Skip to content

Commit eb28bdb

Browse files
Fixed code database not replacing codes
1 parent 3d7d858 commit eb28bdb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Source/HedgeModManager/ModDatabaseGeneric.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ public void LoadSingleCodeFile(string path)
263263
{
264264
if (File.Exists(path))
265265
{
266-
Codes.AddRange(CodeFile.FromFile(path).Codes);
266+
var codeFile = CodeFile.FromFile(path);
267+
foreach (var code in codeFile.Codes)
268+
{
269+
Codes.RemoveAll(x => (x.Name == code.Name && x.Category == code.Category) || (!string.IsNullOrEmpty(x.ID) && x.ID == code.ID));
270+
Codes.Add(code);
271+
}
267272
}
268273
}
269274
catch

0 commit comments

Comments
 (0)