From 1b9c78102cb366606857f5a00540a2234c311292 Mon Sep 17 00:00:00 2001 From: Neo-Silver Date: Tue, 17 Feb 2026 11:07:32 +0100 Subject: [PATCH] Add StackQty As Property - added the offset for StackQty - thanks to AMB for providing the Offset --- pkg/data/items.go | 1 + pkg/memory/item.go | 16 +++------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pkg/data/items.go b/pkg/data/items.go index ebc5265..2296615 100644 --- a/pkg/data/items.go +++ b/pkg/data/items.go @@ -111,6 +111,7 @@ type Item struct { InTradeOrStoreScreen bool IsInSocket bool UniqueSetID int32 + StackedQuantity int } type Drop struct { diff --git a/pkg/memory/item.go b/pkg/memory/item.go index 943d272..8c7ebf2 100644 --- a/pkg/memory/item.go +++ b/pkg/memory/item.go @@ -369,19 +369,9 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD statsListExPtr := uintptr(ReadUIntFromBuffer(itemDataBuffer, 0x88, Uint64)) itm.BaseStats, itm.Stats = gd.getItemStats(statsListExPtr) - // // Read stack quantity from UnitData+0x9C (DLC tabs store quantity here instead of in stats) - // stackQty := gd.Process.ReadUInt(unitDataPtr+0x9C, Uint32) - // found := false - // for i := range itm.Stats { - // if itm.Stats[i].ID == stat.Quantity && itm.Stats[i].Layer == 0 { - // itm.Stats[i].Value = int(stackQty) - // found = true - // break - // } - // } - // if !found && stackQty > 0 { - // itm.Stats = append(itm.Stats, stat.Data{ID: stat.Quantity, Value: int(stackQty), Layer: 0}) - // } + // stack quantity as item property + stackQty := gd.Process.ReadUInt(unitDataPtr+0x9C, Uint32) + itm.StackedQuantity = int(stackQty) // Process socket information if location == item.LocationSocket {