From 17ced445045881221c5f07fa3cecd6c8a721b82b Mon Sep 17 00:00:00 2001 From: vietdungdev Date: Fri, 22 May 2026 22:35:24 +0700 Subject: [PATCH] fix item level require and properties --- pkg/memory/item.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/memory/item.go b/pkg/memory/item.go index 31e29df..1904af9 100644 --- a/pkg/memory/item.go +++ b/pkg/memory/item.go @@ -144,9 +144,6 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary UniqueSetID: txtUniqueSet, } - // Set item properties - setProperties(itm, uint32(flags)) - // Read rare affixes rarePrefix := int16(ReadUIntFromBuffer(unitDataBuffer, 0x42, Uint16)) rareSuffix := int16(ReadUIntFromBuffer(unitDataBuffer, 0x44, Uint16)) @@ -378,6 +375,9 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary continue } + // Set item properties + setProperties(itm, uint32(flags)) + // Read item stats statsListExPtr := uintptr(ReadUIntFromBuffer(itemDataBuffer, 0x88, Uint64)) itm.BaseStats, itm.Stats = gd.getItemStats(statsListExPtr) @@ -499,8 +499,9 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary maxReq := calculateItemLevelReq(itm, baseDesc) // Check magic/rare affixes - //|| itm.Quality == item.QualityRare sai voi rare item - if itm.Identified && (itm.Quality == item.QualityMagic || itm.Quality == item.QualityCrafted) { + //itm.Quality == item.QualityMagic || + //itm.Quality == item.QualityRare || + if itm.Identified && (itm.Quality == item.QualityCrafted) { maxReq = updateMaxReqFromAffixes(maxReq, itm.Affixes) } @@ -653,7 +654,7 @@ func setProperties(item *data.Item, flags uint32) { item.IsEar = true } if 0x2000&flags != 0 { - item.InTradeOrStoreScreen = true // If item is sold to vendor or placed in trade with another player + item.InTradeOrStoreScreen = item.Owner == 0 // If item is sold to vendor or placed in trade with another player } if 0x800&flags != 0 { item.HasSockets = true