mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8902] Do can store check at loading item to bag in same way as for other cases
This commit is contained in:
parent
68581bd918
commit
d5d3f6d26a
2 changed files with 10 additions and 3 deletions
|
|
@ -15289,9 +15289,9 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
|
||||||
|
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
|
// the item/bag is not in a bag
|
||||||
if (!bag_guid)
|
if (!bag_guid)
|
||||||
{
|
{
|
||||||
// the item is not in a bag
|
|
||||||
item->SetContainer( NULL );
|
item->SetContainer( NULL );
|
||||||
item->SetSlot(slot);
|
item->SetSlot(slot);
|
||||||
|
|
||||||
|
|
@ -15327,13 +15327,20 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
|
||||||
bagMap[item_guid] = (Bag*)item;
|
bagMap[item_guid] = (Bag*)item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// the item/bag in a bag
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->SetSlot(NULL_SLOT);
|
item->SetSlot(NULL_SLOT);
|
||||||
// the item is in a bag, find the bag
|
// the item is in a bag, find the bag
|
||||||
std::map<uint64, Bag*>::const_iterator itr = bagMap.find(bag_guid);
|
std::map<uint64, Bag*>::const_iterator itr = bagMap.find(bag_guid);
|
||||||
if(itr != bagMap.end() && slot < itr->second->GetBagSize())
|
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
|
else
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8901"
|
#define REVISION_NR "8902"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue