improve item, them owner

This commit is contained in:
vietdungdev
2026-05-08 21:26:09 +07:00
parent 839b04fd89
commit 094eda658f
2 changed files with 25 additions and 24 deletions

View File

@@ -51,10 +51,9 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
}
inventory := data.Inventory{
Gold: inventoryGold.Value,
StashedGold: stashedGold,
SharedStashPages: len(stashPlayerUnitOrder),
MySharedStashPage: int(stashUnitIDToPage[uint(mainPlayer.UnitID)]),
Gold: inventoryGold.Value,
StashedGold: stashedGold,
SharedStashPages: len(stashPlayerUnitOrder),
}
belt := data.Belt{}
@@ -132,6 +131,7 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
itm := &data.Item{
ID: int(txtFileNo),
UnitID: data.UnitID(unitID),
Owner: data.UnitID(itemOwnerNPC),
Name: item.GetNameByEnum(txtFileNo),
Quality: item.Quality(itemQuality),
Position: data.Position{
@@ -142,6 +142,9 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
Sockets: make([]data.Item, 0),
UniqueSetID: txtUniqueSet,
}
if itm.Owner == 1 {
itm.Owner = mainPlayer.UnitID
}
// Set item properties
setProperties(itm, uint32(flags))