update item owner
This commit is contained in:
@@ -144,6 +144,11 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary
|
||||
UniqueSetID: txtUniqueSet,
|
||||
}
|
||||
|
||||
itm.Owner = data.UnitID(itemOwnerNPC)
|
||||
if itemOwnerNPC == 1 {
|
||||
itm.Owner = mainPlayer.UnitID
|
||||
}
|
||||
|
||||
// Read rare affixes
|
||||
rarePrefix := int16(ReadUIntFromBuffer(unitDataBuffer, 0x42, Uint16))
|
||||
rareSuffix := int16(ReadUIntFromBuffer(unitDataBuffer, 0x44, Uint16))
|
||||
@@ -281,7 +286,6 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary
|
||||
location = classifyDLCTabItem(txtFileNo)
|
||||
}
|
||||
} else if data.UnitID(itemOwnerNPC) == mainPlayer.UnitID || itemOwnerNPC == 1 {
|
||||
itm.Owner = mainPlayer.UnitID
|
||||
|
||||
if invPage == 0 {
|
||||
location = item.LocationInventory
|
||||
@@ -294,28 +298,15 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary
|
||||
}
|
||||
}
|
||||
|
||||
if location == item.LocationSharedStash {
|
||||
MySharedStashPage := stashUnitIDToPage[uint(mainPlayer.UnitID)]
|
||||
if invPage == MySharedStashPage {
|
||||
itm.Owner = mainPlayer.UnitID
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
isMercItem := (flags & 0x800000) != 0
|
||||
if data.UnitID(itemOwnerNPC) == mainPlayer.UnitID || itemOwnerNPC == 1 {
|
||||
itm.Owner = mainPlayer.UnitID
|
||||
|
||||
location = item.LocationEquipped
|
||||
if itm.Type().Code == item.TypeBelt {
|
||||
belt.Name = itm.Name
|
||||
}
|
||||
} else if isMercItem {
|
||||
if merc.Found {
|
||||
itm.Owner = merc.UnitID
|
||||
} else {
|
||||
itm.Owner = data.UnitID(itemOwnerNPC)
|
||||
}
|
||||
|
||||
location = item.LocationMercenary
|
||||
}
|
||||
case 2:
|
||||
|
||||
Reference in New Issue
Block a user