Core: More warning fixes
This commit is contained in:
@@ -11150,7 +11150,6 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
if (pItem->IsBindedNotWith(this))
|
||||
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
|
||||
|
||||
Bag *pBag;
|
||||
ItemTemplate const *pBagProto;
|
||||
|
||||
// item is 'one item only'
|
||||
@@ -11201,11 +11200,11 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
|
||||
for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
|
||||
{
|
||||
if (pBag = GetBagByPos(t))
|
||||
if (Bag* bag = GetBagByPos(t))
|
||||
{
|
||||
if (ItemCanGoIntoBag(pItem->GetTemplate(), pBag->GetTemplate()))
|
||||
if (ItemCanGoIntoBag(pItem->GetTemplate(), bag->GetTemplate()))
|
||||
{
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
for (uint32 j = 0; j < bag->GetBagSize(); j++)
|
||||
{
|
||||
pItem2 = GetItemByPos(t, j);
|
||||
if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize())
|
||||
@@ -11258,15 +11257,15 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
|
||||
for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
|
||||
{
|
||||
if (pBag = GetBagByPos(t))
|
||||
if (Bag* bag = GetBagByPos(t))
|
||||
{
|
||||
pBagProto = pBag->GetTemplate();
|
||||
pBagProto = bag->GetTemplate();
|
||||
|
||||
// not plain container check
|
||||
if (pBagProto && (pBagProto->Class != ITEM_CLASS_CONTAINER || pBagProto->SubClass != ITEM_SUBCLASS_CONTAINER) &&
|
||||
ItemCanGoIntoBag(pProto, pBagProto))
|
||||
{
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
for (uint32 j = 0; j < bag->GetBagSize(); j++)
|
||||
{
|
||||
if (inv_bags[t-INVENTORY_SLOT_BAG_START][j] == 0)
|
||||
{
|
||||
@@ -11297,15 +11296,15 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
// search free slot in bags
|
||||
for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
|
||||
{
|
||||
if (pBag = GetBagByPos(t))
|
||||
if (Bag* bag = GetBagByPos(t))
|
||||
{
|
||||
pBagProto = pBag->GetTemplate();
|
||||
pBagProto = bag->GetTemplate();
|
||||
|
||||
// special bag already checked
|
||||
if (pBagProto && (pBagProto->Class != ITEM_CLASS_CONTAINER || pBagProto->SubClass != ITEM_SUBCLASS_CONTAINER))
|
||||
continue;
|
||||
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
for (uint32 j = 0; j < bag->GetBagSize(); j++)
|
||||
{
|
||||
if (inv_bags[t-INVENTORY_SLOT_BAG_START][j] == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user