From eed11bb67f46221cf1483ccae7311f8bb090c46e Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sat, 25 Nov 2023 19:52:30 +0100 Subject: [PATCH] Fix HQ Item IDs in inventory service. --- Glamourer/Interop/InventoryService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Glamourer/Interop/InventoryService.cs b/Glamourer/Interop/InventoryService.cs index 4235da4..6e72e91 100644 --- a/Glamourer/Interop/InventoryService.cs +++ b/Glamourer/Interop/InventoryService.cs @@ -70,7 +70,7 @@ public unsafe class InventoryService : IDisposable else if (item.GlamourId != 0) _itemList.Add((slot, item.GlamourId, item.Stain)); else - _itemList.Add((slot, item.ItemID, item.Stain)); + _itemList.Add((slot, FixId(item.ItemID), item.Stain)); } var plate = MirageManager.Instance()->GlamourPlatesSpan[glamourPlateId - 1]; @@ -96,7 +96,7 @@ public unsafe class InventoryService : IDisposable else if (item.GlamourId != 0) _itemList.Add((slot, item.GlamourId, item.Stain)); else - _itemList.Add((slot, item.ItemID, item.Stain)); + _itemList.Add((slot, FixId(item.ItemID), item.Stain)); } Add(EquipSlot.MainHand, ref entry->MainHand); @@ -119,6 +119,9 @@ public unsafe class InventoryService : IDisposable return ret; } + private static uint FixId(uint itemId) + => itemId % 50000; + private delegate int MoveItemDelegate(InventoryManager* manager, InventoryType sourceContainer, ushort sourceSlot, InventoryType targetContainer, ushort targetSlot, byte unk);