mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[9580] Add ObjectGuid const& Object::GetObjectGuid() and restore build.
This commit is contained in:
parent
2bf75e7a10
commit
ab7840a591
16 changed files with 32 additions and 32 deletions
|
|
@ -8691,26 +8691,26 @@ Item* Player::GetItemByGuid(ObjectGuid guid) const
|
|||
{
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
||||
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
if (pItem->GetGUID() == guid.GetRawValue())
|
||||
if (pItem->GetObjectGuid() == guid)
|
||||
return pItem;
|
||||
|
||||
for(int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
|
||||
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
if (pItem->GetGUID() == guid.GetRawValue())
|
||||
if (pItem->GetObjectGuid() == guid)
|
||||
return pItem;
|
||||
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
||||
if (Item* pItem = pBag->GetItemByPos(j))
|
||||
if (pItem->GetGUID() == guid.GetRawValue())
|
||||
if (pItem->GetObjectGuid() == guid)
|
||||
return pItem;
|
||||
|
||||
for(int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
|
||||
if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
||||
if (Item* pItem = pBag->GetItemByPos(j))
|
||||
if (pItem->GetGUID() == guid.GetRawValue())
|
||||
if (pItem->GetObjectGuid() == guid)
|
||||
return pItem;
|
||||
|
||||
return NULL;
|
||||
|
|
@ -21685,13 +21685,13 @@ Object* Player::GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask)
|
|||
{
|
||||
case HIGHGUID_ITEM:
|
||||
if (typemask & TYPEMASK_ITEM)
|
||||
return GetItemByGuid(guid.GetRawValue());
|
||||
return GetItemByGuid(guid);
|
||||
break;
|
||||
case HIGHGUID_PLAYER:
|
||||
if (GetGUID()==guid.GetRawValue())
|
||||
if (GetObjectGuid()==guid)
|
||||
return this;
|
||||
if ((typemask & TYPEMASK_PLAYER) && IsInWorld())
|
||||
return ObjectAccessor::FindPlayer(guid.GetRawValue());
|
||||
return ObjectAccessor::FindPlayer(guid);
|
||||
break;
|
||||
case HIGHGUID_GAMEOBJECT:
|
||||
if ((typemask & TYPEMASK_GAMEOBJECT) && IsInWorld())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue