mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 19:37:02 +00:00
Merge branch 'master' into 310
Conflicts: src/game/Player.cpp
This commit is contained in:
commit
f6e2b55e2c
25 changed files with 382 additions and 240 deletions
|
|
@ -696,18 +696,19 @@ bool Item::IsEquipped() const
|
|||
return !IsInBag() && m_slot < EQUIPMENT_SLOT_END;
|
||||
}
|
||||
|
||||
bool Item::CanBeTraded() const
|
||||
bool Item::CanBeTraded(bool mail) const
|
||||
{
|
||||
if(IsSoulBound())
|
||||
return false;
|
||||
if(IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()) )
|
||||
if ((!mail || !IsBoundAccountWide()) && IsSoulBound())
|
||||
return false;
|
||||
|
||||
if(Player* owner = GetOwner())
|
||||
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()) )
|
||||
return false;
|
||||
|
||||
if (Player* owner = GetOwner())
|
||||
{
|
||||
if(owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK )
|
||||
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK )
|
||||
return false;
|
||||
if(owner->GetLootGUID()==GetGUID())
|
||||
if (owner->GetLootGUID()==GetGUID())
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -941,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