update item owner

This commit is contained in:
vietdungdev
2026-05-24 22:37:32 +07:00
parent 41abbe5217
commit e8a41dc79c
3 changed files with 18 additions and 14 deletions

View File

@@ -14,18 +14,15 @@ type Inventory struct {
StashedGold [6]int // [0]=personal, [1..5]=shared stash pages
SharedStashPages int // Number of shared stash units detected (3=non-DLC, 5+=DLC)
PlayerID UnitID // Number of shared stash units detected (3=non-DLC, 5+=DLC)
MercID UnitID
}
func (i Inventory) isMatchOwner(it Item) bool {
if it.Location.LocationType == item.LocationUnknown ||
it.Location.LocationType == item.LocationGround || it.Location.LocationType == item.LocationVendor {
it.Location.LocationType == item.LocationGround ||
it.Location.LocationType == item.LocationMercenary || it.Location.LocationType == item.LocationVendor {
return true
}
if it.Location.LocationType == item.LocationMercenary {
return i.MercID != 0 && it.Owner == i.MercID
}
return it.Owner == i.PlayerID
}