Skip to content

Commit 8a7f841

Browse files
committed
Add allowance for metadata files in other data files.
1 parent 8360d46 commit 8a7f841

File tree

1 file changed

+8
-3
lines changed
  • xivModdingFramework/Mods/FileTypes

1 file changed

+8
-3
lines changed

xivModdingFramework/Mods/FileTypes/TTMP.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ await Task.Run(async () =>
682682

683683
// ModList is updated now. Time to expand the Metadata files.
684684
Dictionary<XivDataFile, IndexFile> indexFiles = new Dictionary<XivDataFile, IndexFile>();
685-
List<ItemMetadata> metadataEntries = new List<ItemMetadata>();
685+
Dictionary<XivDataFile, List<ItemMetadata>> metadataEntries = new Dictionary<XivDataFile, List<ItemMetadata>>;
686686
foreach (var file in filePaths)
687687
{
688688
if (ErroneousFiles.Contains(file)) continue;
@@ -697,14 +697,15 @@ await Task.Run(async () =>
697697
if (!indexFiles.ContainsKey(df))
698698
{
699699
indexFiles.Add(df, await _index.GetIndexFile(df));
700+
metadataEntries.Add(df, new List<ItemMetadata>());
700701
}
701702

702703
var metaRaw = await dat.GetType2Data(longOffset, df);
703704
var meta = await ItemMetadata.Deserialize(metaRaw);
704705

705706
meta.Validate(file);
706707

707-
metadataEntries.Add(meta);
708+
metadataEntries[df].Add(meta);
708709
} catch(Exception ex)
709710
{
710711
ErroneousFiles.Add(file);
@@ -716,7 +717,11 @@ await Task.Run(async () =>
716717
}
717718
}
718719

719-
await ItemMetadata.ApplyMetadataBatched(metadataEntries, indexFiles[XivDataFile._04_Chara], modList);
720+
foreach(var ifKv in indexFiles)
721+
{
722+
await ItemMetadata.ApplyMetadataBatched(metadataEntries[ifKv.Key], ifKv.Value, modList);
723+
724+
}
720725

721726
foreach(var kv in indexFiles)
722727
{

0 commit comments

Comments
 (0)