Skip to content

Commit 6d2a8aa

Browse files
committed
Removed irrelevant item pull when saving metadata.
1 parent 2267829 commit 6d2a8aa

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

xivModdingFramework/Mods/FileTypes/ItemMetadata.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,10 @@ internal static async Task ApplyMetadata(ItemMetadata meta, IndexFile index = nu
320320
var _modding = new Modding(XivCache.GameInfo.GameDirectory);
321321
var _index = new Index(XivCache.GameInfo.GameDirectory);
322322
var df = IOUtil.GetDataFileFromPath(meta.Root.Info.GetRootFile());
323-
var item = meta.Root.GetFirstItem();
323+
324+
var dummyItem = new XivGenericItemModel();
325+
dummyItem.Name = Constants.InternalModSourceName;
326+
dummyItem.SecondaryCategory = Constants.InternalModSourceName;
324327

325328

326329
bool doSave = false;
@@ -336,30 +339,30 @@ internal static async Task ApplyMetadata(ItemMetadata meta, IndexFile index = nu
336339
{
337340
var _imc = new Imc(XivCache.GameInfo.GameDirectory);
338341
var imcPath = meta.Root.GetRawImcFilePath();
339-
await _imc.SaveEntries(imcPath, meta.Root.Info.Slot, meta.ImcEntries, item, index, modlist);
342+
await _imc.SaveEntries(imcPath, meta.Root.Info.Slot, meta.ImcEntries, dummyItem, index, modlist);
340343
}
341344

342345
// Applying EQP data via set 0 is not allowed, as it is a special set hard-coded to use Set 1's data.
343346
if(meta.EqpEntry != null && !(meta.Root.Info.PrimaryType == Items.Enums.XivItemType.equipment && meta.Root.Info.PrimaryId == 0))
344347
{
345-
await _eqp.SaveEqpEntry(meta.Root.Info.PrimaryId, meta.EqpEntry, item, index, modlist);
348+
await _eqp.SaveEqpEntry(meta.Root.Info.PrimaryId, meta.EqpEntry, dummyItem, index, modlist);
346349
}
347350

348351
if(meta.EqdpEntries.Count > 0)
349352
{
350-
await _eqp.SaveEqdpEntries((uint)meta.Root.Info.PrimaryId, meta.Root.Info.Slot, meta.EqdpEntries, item, index, modlist);
353+
await _eqp.SaveEqdpEntries((uint)meta.Root.Info.PrimaryId, meta.Root.Info.Slot, meta.EqdpEntries, dummyItem, index, modlist);
351354
}
352355

353356
if (meta.EstEntries.Count > 0)
354357
{
355358
var type = Est.GetEstType(meta.Root);
356359
var entries = meta.EstEntries.Values.ToList();
357-
await Est.SaveExtraSkeletonEntries(type, entries, item, index, modlist);
360+
await Est.SaveExtraSkeletonEntries(type, entries, dummyItem, index, modlist);
358361
}
359362

360363
if(meta.GmpEntry != null)
361364
{
362-
await _eqp.SaveGimmickParameter(meta.Root.Info.PrimaryId, meta.GmpEntry, item, index, modlist);
365+
await _eqp.SaveGimmickParameter(meta.Root.Info.PrimaryId, meta.GmpEntry, dummyItem, index, modlist);
363366
}
364367

365368
if (doSave)

0 commit comments

Comments
 (0)