[7900] Now really allow recieve account bounded items by mail reciver.

This commit is contained in:
VladimirMangos 2009-05-27 10:53:02 +04:00
parent ba1d0684da
commit 1abe4c0d79
4 changed files with 33 additions and 7 deletions

View file

@ -942,3 +942,29 @@ Item* Item::CloneItem( uint32 count, Player const* player ) const
newItem->SetItemRandomProperties(GetItemRandomPropertyId());
return newItem;
}
bool Item::IsBindedNotWith( Player const* player ) const
{
// not binded item
if(!IsSoulBound())
return false;
// own item
if(GetOwnerGUID()== player->GetGUID())
return false;
// not BOA item case
if(!IsBoundAccountWide())
return true;
// online
if(Player* owner = objmgr.GetPlayer(GetOwnerGUID()))
{
return owner->GetSession()->GetAccountId() != player->GetSession()->GetAccountId();
}
// offline slow case
else
{
return objmgr.GetPlayerAccountIdByGUID(GetOwnerGUID()) != player->GetSession()->GetAccountId();
}
}