rendered paste bodyIndex: src/game/Item.cpp
===================================================================
--- src/game/Item.cpp (revision 5687)
+++ src/game/Item.cpp (working copy)
@@ -620,7 +620,7 @@
{
if(IsSoulBound())
return false;
- if(IsBag() && !((Bag const*)this)->IsEmpty())
+ if(IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()) )
return false;
if(Player* owner = GetOwner())
Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp (revision 5687)
+++ src/game/Player.cpp (working copy)
@@ -7841,13 +7841,6 @@
return false;
}
-bool Player::IsBankBagPos( uint8 bag, uint8 slot )
-{
- if( bag == INVENTORY_SLOT_BAG_0 && ( slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END ) )
- return true;
- return false;
-}
-
bool Player::IsBankPos( uint8 bag, uint8 slot )
{
if( bag == INVENTORY_SLOT_BAG_0 && ( slot >= BANK_SLOT_ITEM_START && slot < BANK_SLOT_ITEM_END ) )
@@ -9365,7 +9358,7 @@
if( pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP ||
pItem->GetProto()->Bonding == BIND_QUEST_ITEM ||
- pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBankBagPos(bag,slot) )
+ pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) )
pItem->SetBinding( true );
if( bag == INVENTORY_SLOT_BAG_0 )
@@ -9411,7 +9404,7 @@
{
if( pItem2->GetProto()->Bonding == BIND_WHEN_PICKED_UP ||
pItem2->GetProto()->Bonding == BIND_QUEST_ITEM ||
- pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBankBagPos(bag,slot) )
+ pItem2->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos) )
pItem2->SetBinding( true );
pItem2->SetCount( pItem2->GetCount() + count );
@@ -13926,12 +13919,12 @@
if (test == NULL)
{
- sLog.outError("Player::_SaveInventory - the bag(%d) and slot(%d) values for the item with guid %d are incorrect, the player doesn't have an item at that position!", item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow());
+ sLog.outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%d) and slot(%d) values for the item with guid %d are incorrect, the player doesn't have an item at that position!", GetGUIDLow(), GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow());
error = true;
}
else if (test != item)
{
- sLog.outError("Player::_SaveInventory - the bag(%d) and slot(%d) values for the item with guid %d are incorrect, the item with guid %d is there instead!", item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow());
+ sLog.outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%d) and slot(%d) values for the item with guid %d are incorrect, the item with guid %d is there instead!", GetGUIDLow(), GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow());
error = true;
}
}
Index: src/game/Player.h
===================================================================
--- src/game/Player.h (revision 5687)
+++ src/game/Player.h (working copy)
@@ -1012,7 +1012,6 @@
static bool IsBagPos( uint16 pos );
static bool IsBankPos( uint16 pos ) { return IsBankPos(pos >> 8,pos & 255); }
static bool IsBankPos( uint8 bag, uint8 slot );
- static bool IsBankBagPos( uint8 bag, uint8 slot );
static bool IsWeaponSlot( uint8 slot ) { return slot==EQUIPMENT_SLOT_MAINHAND || slot==EQUIPMENT_SLOT_OFFHAND || slot==EQUIPMENT_SLOT_RANGED; }
bool HasBankBagSlot( uint8 slot ) const;
bool HasItemCount( uint32 item, uint32 count, bool inBankAlso = false ) const;