Ensure standard header copies all fields

This commit is contained in:
Matt Nadareski
2024-09-30 19:47:56 -04:00
parent 5f84a6ffe4
commit d271d8e0b8

View File

@@ -151,6 +151,18 @@ namespace SabreTools.DatFiles
if (header.ContainsKey(fieldName))
_internal[fieldName] = header[fieldName];
}
// Get all fields specific to the DatFiles implementation
var nonStandardFields = TypeHelper.GetConstants(typeof(DatHeader));
if (nonStandardFields == null)
return;
// Populate the internal machine from filter fields
foreach (string fieldName in nonStandardFields)
{
if (header.ContainsKey(fieldName))
_internal[fieldName] = header[fieldName];
}
}
#endregion