示例#1
0
func (p *Player) RestoreSlot(item gameObjectsBase.Itemer, slotIota int) {
	p.Inventory.RestoreItem(item)
	p.slots[slotIota].item = item
	if ok, s := p.getNearbySlot(slotIota, item.GetItemSubtype()); ok {
		if p.slots[s].item != nil {
			p.slots[s].item = nil
		}
		// p.slots[s].item = item
	}
	item.EquipItem(p.Inventory)
	item.SetOwner(p)
}
示例#2
0
func (p *Player) RestoreItem(item gameObjectsBase.Itemer, place int) {
	p.Inventory.RestoreItem(item, place)
	item.SetOwner(p)
}