[8092] No, one more not safe place found.

Patch inspired bug report connected with alt.patch written by Machiavelli.
This commit is contained in:
VladimirMangos 2009-06-29 13:19:42 +04:00 committed by tomrus88
parent 5a8640a69b
commit 8e05eb53d3
2 changed files with 151 additions and 148 deletions

View file

@ -8703,39 +8703,42 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
Item* pItem2 = GetItemByPos( bag, slot );
// ignore move item (this slot will be empty at move)
if(pItem2==pSrcItem)
if (pItem2==pSrcItem)
pItem2 = NULL;
uint32 need_space;
// empty specific slot - check item fit to slot
if( !pItem2 || swap )
if (!pItem2 || swap)
{
if( bag == INVENTORY_SLOT_BAG_0 )
if (bag == INVENTORY_SLOT_BAG_0)
{
// keyring case
if(slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_START+GetMaxKeyringSize() && !(pProto->BagFamily & BAG_FAMILY_MASK_KEYS))
if (slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_START+GetMaxKeyringSize() && !(pProto->BagFamily & BAG_FAMILY_MASK_KEYS))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// currencytoken case
if(slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS))
if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// prevent cheating
if(slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END || slot >= PLAYER_SLOT_END)
if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END || slot >= PLAYER_SLOT_END)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
}
else
{
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag );
if( !pBag )
if (!pBag)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
ItemPrototype const* pBagProto = pBag->GetProto();
if( !pBagProto )
if (!pBagProto)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
if( !ItemCanGoIntoBag(pProto,pBagProto) )
if (slot >= pBagProto->ContainerSlots)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
if (!ItemCanGoIntoBag(pProto,pBagProto))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
}
@ -8746,22 +8749,22 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
else
{
// check item type
if(pItem2->GetEntry() != pProto->ItemId)
if (pItem2->GetEntry() != pProto->ItemId)
return EQUIP_ERR_ITEM_CANT_STACK;
// check free space
if(pItem2->GetCount() >= pProto->GetMaxStackSize())
if (pItem2->GetCount() >= pProto->GetMaxStackSize())
return EQUIP_ERR_ITEM_CANT_STACK;
// free stack space or infinity
need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
}
if(need_space > count)
if (need_space > count)
need_space = count;
ItemPosCount newPosition = ItemPosCount((bag << 8) | slot, need_space);
if(!newPosition.isContainedIn(dest))
if (!newPosition.isContainedIn(dest))
{
dest.push_back(newPosition);
count -= need_space;
@ -8772,55 +8775,55 @@ uint8 Player::_CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountV
uint8 Player::_CanStoreItem_InBag( uint8 bag, ItemPosCountVec &dest, ItemPrototype const *pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot ) const
{
// skip specific bag already processed in first called _CanStoreItem_InBag
if(bag==skip_bag)
if (bag==skip_bag)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, bag );
if( !pBag )
if (!pBag)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
ItemPrototype const* pBagProto = pBag->GetProto();
if( !pBagProto )
if (!pBagProto)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
// specialized bag mode or non-specilized
if( non_specialized != (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER) )
if (non_specialized != (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
if( !ItemCanGoIntoBag(pProto,pBagProto) )
if (!ItemCanGoIntoBag(pProto,pBagProto))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
for(uint32 j = 0; j < pBag->GetBagSize(); ++j)
{
// skip specific slot already processed in first called _CanStoreItem_InSpecificSlot
if(j==skip_slot)
if (j==skip_slot)
continue;
Item* pItem2 = GetItemByPos( bag, j );
// ignore move item (this slot will be empty at move)
if(pItem2==pSrcItem)
if (pItem2==pSrcItem)
pItem2 = NULL;
// if merge skip empty, if !merge skip non-empty
if((pItem2!=NULL)!=merge)
if ((pItem2!=NULL)!=merge)
continue;
if( pItem2 )
if (pItem2)
{
if(pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
if (pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
{
uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
if(need_space > count)
need_space = count;
ItemPosCount newPosition = ItemPosCount((bag << 8) | j, need_space);
if(!newPosition.isContainedIn(dest))
if (!newPosition.isContainedIn(dest))
{
dest.push_back(newPosition);
count -= need_space;
if(count==0)
if (count==0)
return EQUIP_ERR_OK;
}
}
@ -8828,16 +8831,16 @@ uint8 Player::_CanStoreItem_InBag( uint8 bag, ItemPosCountVec &dest, ItemPrototy
else
{
uint32 need_space = pProto->GetMaxStackSize();
if(need_space > count)
if (need_space > count)
need_space = count;
ItemPosCount newPosition = ItemPosCount((bag << 8) | j, need_space);
if(!newPosition.isContainedIn(dest))
if (!newPosition.isContainedIn(dest))
{
dest.push_back(newPosition);
count -= need_space;
if(count==0)
if (count==0)
return EQUIP_ERR_OK;
}
}
@ -8850,33 +8853,33 @@ uint8 Player::_CanStoreItem_InInventorySlots( uint8 slot_begin, uint8 slot_end,
for(uint32 j = slot_begin; j < slot_end; ++j)
{
// skip specific slot already processed in first called _CanStoreItem_InSpecificSlot
if(INVENTORY_SLOT_BAG_0==skip_bag && j==skip_slot)
if (INVENTORY_SLOT_BAG_0==skip_bag && j==skip_slot)
continue;
Item* pItem2 = GetItemByPos( INVENTORY_SLOT_BAG_0, j );
// ignore move item (this slot will be empty at move)
if(pItem2==pSrcItem)
if (pItem2==pSrcItem)
pItem2 = NULL;
// if merge skip empty, if !merge skip non-empty
if((pItem2!=NULL)!=merge)
if ((pItem2!=NULL)!=merge)
continue;
if( pItem2 )
if (pItem2)
{
if(pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
if (pItem2->GetEntry() == pProto->ItemId && pItem2->GetCount() < pProto->GetMaxStackSize())
{
uint32 need_space = pProto->GetMaxStackSize() - pItem2->GetCount();
if(need_space > count)
if (need_space > count)
need_space = count;
ItemPosCount newPosition = ItemPosCount((INVENTORY_SLOT_BAG_0 << 8) | j, need_space);
if(!newPosition.isContainedIn(dest))
if (!newPosition.isContainedIn(dest))
{
dest.push_back(newPosition);
count -= need_space;
if(count==0)
if (count==0)
return EQUIP_ERR_OK;
}
}
@ -8884,16 +8887,16 @@ uint8 Player::_CanStoreItem_InInventorySlots( uint8 slot_begin, uint8 slot_end,
else
{
uint32 need_space = pProto->GetMaxStackSize();
if(need_space > count)
if (need_space > count)
need_space = count;
ItemPosCount newPosition = ItemPosCount((INVENTORY_SLOT_BAG_0 << 8) | j, need_space);
if(!newPosition.isContainedIn(dest))
if (!newPosition.isContainedIn(dest))
{
dest.push_back(newPosition);
count -= need_space;
if(count==0)
if (count==0)
return EQUIP_ERR_OK;
}
}
@ -8906,16 +8909,16 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
sLog.outDebug( "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count);
ItemPrototype const *pProto = objmgr.GetItemPrototype(entry);
if( !pProto )
if (!pProto)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count;
return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED :EQUIP_ERR_ITEM_NOT_FOUND;
}
if(pItem && pItem->IsBindedNotWith(this))
if (pItem && pItem->IsBindedNotWith(this))
{
if(no_space_count)
if (no_space_count)
*no_space_count = count;
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
}
@ -8923,11 +8926,11 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
// check count of items (skip for auto move for same player from bank)
uint32 no_similar_count = 0; // can't store this amount similar items
uint8 res = _CanTakeMoreSimilarItems(entry,count,pItem,&no_similar_count);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(count==no_similar_count)
if (count==no_similar_count)
{
if(no_space_count)
if (no_space_count)
*no_space_count = no_similar_count;
return res;
}
@ -8935,22 +8938,22 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
}
// in specific slot
if( bag != NULL_BAG && slot != NULL_SLOT )
if (bag != NULL_BAG && slot != NULL_SLOT)
{
res = _CanStoreItem_InSpecificSlot(bag,slot,dest,pProto,count,swap,pItem);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -8959,45 +8962,45 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
// not specific slot or have space for partly store only in specific slot
// in specific bag
if( bag != NULL_BAG )
if (bag != NULL_BAG)
{
// search stack in bag for merge to
if( pProto->Stackable != 1 )
if (pProto->Stackable != 1)
{
if( bag == INVENTORY_SLOT_BAG_0 ) // inventory
if (bag == INVENTORY_SLOT_BAG_0) // inventory
{
res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9006,22 +9009,22 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
{
// we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag
res = _CanStoreItem_InBag(bag,dest,pProto,count,true,false,pItem,NULL_BAG,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
res = _CanStoreItem_InBag(bag,dest,pProto,count,true,true,pItem,NULL_BAG,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9029,83 +9032,83 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
}
// search free slot in bag for place to
if( bag == INVENTORY_SLOT_BAG_0 ) // inventory
if(bag == INVENTORY_SLOT_BAG_0) // inventory
{
// search free slot - keyring case
if(pProto->BagFamily & BAG_FAMILY_MASK_KEYS)
if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS)
{
uint32 keyringSize = GetMaxKeyringSize();
res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_START+keyringSize,dest,pProto,count,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
else if(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
{
res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9113,22 +9116,22 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
else // equipped bag
{
res = _CanStoreItem_InBag(bag,dest,pProto,count,false,false,pItem,NULL_BAG,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
res = _CanStoreItem_InBag(bag,dest,pProto,count,false,true,pItem,NULL_BAG,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9138,58 +9141,58 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
// not specific bag or have space for partly store only in specific bag
// search stack for merge to
if( pProto->Stackable != 1 )
if (pProto->Stackable != 1)
{
res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
if( pProto->BagFamily )
if (pProto->BagFamily)
{
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
res = _CanStoreItem_InBag(i,dest,pProto,count,true,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
continue;
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9199,15 +9202,15 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
res = _CanStoreItem_InBag(i,dest,pProto,count,true,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
continue;
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9215,45 +9218,45 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
}
// search free slot - special bag case
if( pProto->BagFamily )
if (pProto->BagFamily)
{
if(pProto->BagFamily & BAG_FAMILY_MASK_KEYS)
if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS)
{
uint32 keyringSize = GetMaxKeyringSize();
res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_START+keyringSize,dest,pProto,count,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
else if(pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS)
{
res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9262,15 +9265,15 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
res = _CanStoreItem_InBag(i,dest,pProto,count,false,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
continue;
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9279,19 +9282,19 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
// search free slot
res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
{
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return res;
}
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
@ -9299,21 +9302,21 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
{
res = _CanStoreItem_InBag(i,dest,pProto,count,false,true,pItem,bag,slot);
if(res!=EQUIP_ERR_OK)
if (res!=EQUIP_ERR_OK)
continue;
if(count==0)
if (count==0)
{
if(no_similar_count==0)
if (no_similar_count==0)
return EQUIP_ERR_OK;
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
}
}
if(no_space_count)
if (no_space_count)
*no_space_count = count + no_similar_count;
return EQUIP_ERR_INVENTORY_FULL;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8091"
#define REVISION_NR "8092"
#endif // __REVISION_NR_H__