Skip to content

Commit b60a89c

Browse files
committed
- Corrections for NPC IMC sets (they're 1 based, not 0 based)
1 parent 1f82bb7 commit b60a89c

File tree

1 file changed

+29
-1
lines changed
  • xivModdingFramework/Items/Categories

1 file changed

+29
-1
lines changed

xivModdingFramework/Items/Categories/Gear.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,36 @@ public async Task<List<IItemModel>> GetSameModelList(IItemModel item)
745745
var slot = item.GetItemSlotAbbreviation();
746746
var imcEntries = info.GetAllEntries(slot);
747747

748+
if (sameModelItems.Any(x => x.ModelInfo.ImcSubsetID != 0))
749+
{
750+
// Need to list default IMC set.
751+
// Need to create a new item for it.
752+
var npcItem = new XivGear()
753+
{
754+
Name = "NPC Equipment e" + item.ModelInfo.PrimaryID + " " + slot + " Default Variant",
755+
ModelInfo = new XivGearModelInfo(),
756+
PrimaryCategory = item.PrimaryCategory,
757+
SecondaryCategory = item.SecondaryCategory,
758+
TertiaryCategory = item.TertiaryCategory,
759+
DataFile = item.DataFile,
760+
};
761+
npcItem.ModelInfo.PrimaryID = item.ModelInfo.PrimaryID;
762+
npcItem.ModelInfo.SecondaryID = item.ModelInfo.SecondaryID;
763+
npcItem.ModelInfo.ImcSubsetID = 0;
764+
try
765+
{
766+
((XivGearModelInfo)npcItem.ModelInfo).IsWeapon = ((XivGearModelInfo)item.ModelInfo).IsWeapon;
767+
}
768+
catch
769+
{
770+
// No-op. Should never actually get here, but safety check on the cast.
771+
}
772+
773+
sameModelItems.Add(npcItem);
774+
}
775+
748776
// Need to verify all of our IMC sets are properly represented in the item list.
749-
for (int i = 0; i < imcEntries.Count; i++)
777+
for (int i = 1; i <= imcEntries.Count; i++)
750778
{
751779
// Already in it. All set.
752780
if (sameModelItems.Any(x => x.ModelInfo.ImcSubsetID == i)) continue;

0 commit comments

Comments
 (0)