mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 19:37:02 +00:00
[7900] Now really allow recieve account bounded items by mail reciver.
This commit is contained in:
parent
ba1d0684da
commit
1abe4c0d79
4 changed files with 33 additions and 7 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue