Skip to content

Commit

Permalink
[8902] Do can store check at loading item to bag in same way as for o…
Browse files Browse the repository at this point in the history
…ther cases
  • Loading branch information
VladimirMangos committed Dec 2, 2009
1 parent 7a4f9f8 commit 5a7b9f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/game/Player.cpp
Expand Up @@ -15289,9 +15289,9 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)

bool success = true;

// the item/bag is not in a bag
if (!bag_guid)
{
// the item is not in a bag
item->SetContainer( NULL );
item->SetSlot(slot);

Expand Down Expand Up @@ -15327,13 +15327,20 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
bagMap[item_guid] = (Bag*)item;
}
}
// the item/bag in a bag
else
{
item->SetSlot(NULL_SLOT);
// the item is in a bag, find the bag
std::map<uint64, Bag*>::const_iterator itr = bagMap.find(bag_guid);
if(itr != bagMap.end() && slot < itr->second->GetBagSize())
itr->second->StoreItem(slot, item, true );
{
ItemPosCountVec dest;
if( CanStoreItem( itr->second->GetSlot(), slot, dest, item, false ) == EQUIP_ERR_OK )
item = StoreItem(dest, item, true);
else
success = false;
}
else
success = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8901"
#define REVISION_NR "8902"
#endif // __REVISION_NR_H__

0 comments on commit 5a7b9f4

Please sign in to comment.