Tipologie server:--------------
*Resursă folosită:post662600.html?hilit=special%20storage#p662600
*ServerFiles utilizat:---------
*Syserr:--------------
Poză:

*Detalii suplimentare: Sunt de parere ca el citeste din Inventarul normal, va las aici functia IsEmptyItemGrid
Cod: Selectaţi tot
bool CHARACTER::IsEmptyItemGrid(TItemPos Cell, BYTE bSize, int iExceptionCell) const
{
switch (Cell.window_type)
{
case INVENTORY:
{
DWORD bCell = Cell.cell;
// bItemCellÀº 0ÀÌ falseÀÓÀ» ³ªÅ¸³»±â À§ÇØ + 1 ÇØ¼ ó¸®ÇÑ´Ù.
// µû¶ó¼ iExceptionCell¿¡ 1À» ´õÇØ ºñ±³ÇÑ´Ù.
++iExceptionCell;
if (Cell.IsBeltInventoryPosition())
{
LPITEM beltItem = GetWear(WEAR_BELT);
if (NULL == beltItem)
return false;
if (false == CBeltInventoryHelper::IsAvailableCell(bCell - BELT_INVENTORY_SLOT_START, beltItem->GetValue(0)))
return false;
if (m_pointsInstant.bItemGrid[bCell])
{
if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell)
return true;
return false;
}
if (bSize == 1)
return true;
}
else if (bCell >= INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.bItemGrid[bCell])
{
if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell)
{
if (bSize == 1)
return true;
int j = 1;
BYTE bPage = bCell / (INVENTORY_MAX_NUM / 5);
do
{
BYTE p = bCell + (5 * j);
if (p >= INVENTORY_MAX_NUM)
return false;
if (p / (INVENTORY_MAX_NUM / 5) != bPage)
return false;
if (m_pointsInstant.bItemGrid[p])
if (m_pointsInstant.bItemGrid[p] != iExceptionCell)
return false;
}
while (++j < bSize);
return true;
}
else
return false;
}
// Å©±â°¡ 1À̸é ÇÑÄÀ» Â÷ÁöÇÏ´Â °ÍÀ̹ǷΠ±×³É ¸®ÅÏ
if (1 == bSize)
return true;
else
{
int j = 1;
BYTE bPage = bCell / (INVENTORY_MAX_NUM / 5);
do
{
BYTE p = bCell + (5 * j);
if (p >= INVENTORY_MAX_NUM)
return false;
if (p / (INVENTORY_MAX_NUM / 5) != bPage)
return false;
if (m_pointsInstant.bItemGrid[p])
if (m_pointsInstant.bItemGrid[p] != iExceptionCell)
return false;
}
while (++j < bSize);
return true;
}
}
break;
case DRAGON_SOUL_INVENTORY:
{
WORD wCell = Cell.cell;
if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
return false;
// bItemCellÀº 0ÀÌ falseÀÓÀ» ³ªÅ¸³»±â À§ÇØ + 1 ÇØ¼ ó¸®ÇÑ´Ù.
// µû¶ó¼ iExceptionCell¿¡ 1À» ´õÇØ ºñ±³ÇÑ´Ù.
iExceptionCell++;
if (m_pointsInstant.wDSItemGrid[wCell])
{
if (m_pointsInstant.wDSItemGrid[wCell] == iExceptionCell)
{
if (bSize == 1)
return true;
int j = 1;
do
{
BYTE p = wCell + (DRAGON_SOUL_BOX_COLUMN_NUM * j);
if (p >= DRAGON_SOUL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.wDSItemGrid[p])
if (m_pointsInstant.wDSItemGrid[p] != iExceptionCell)
return false;
}
while (++j < bSize);
return true;
}
else
return false;
}
// Å©±â°¡ 1À̸é ÇÑÄÀ» Â÷ÁöÇÏ´Â °ÍÀ̹ǷΠ±×³É ¸®ÅÏ
if (1 == bSize)
return true;
else
{
int j = 1;
do
{
BYTE p = wCell + (DRAGON_SOUL_BOX_COLUMN_NUM * j);
if (p >= DRAGON_SOUL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.bItemGrid[p])
if (m_pointsInstant.wDSItemGrid[p] != iExceptionCell)
return false;
}
while (++j < bSize);
return true;
}
}
#ifdef ENABLE_SPECIAL_STORAGE
break;
case UPGRADE_INVENTORY:
{
WORD wCell = Cell.cell;
if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
return false;
iExceptionCell++;
if (m_pointsInstant.wSSUItemGrid[wCell])
{
if (m_pointsInstant.wSSUItemGrid[wCell] == iExceptionCell)
{
if (bSize == 1)
return true;
int j = 1;
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.wSSUItemGrid[p])
if (m_pointsInstant.wSSUItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
else
return false;
}
if (1 == bSize)
return true;
else
{
int j = 1;
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
if (m_pointsInstant.wSSUItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
}
break;
case BOOK_INVENTORY:
{
WORD wCell = Cell.cell;
if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
return false;
iExceptionCell++;
if (m_pointsInstant.wSSBItemGrid[wCell])
{
if (m_pointsInstant.wSSBItemGrid[wCell] == iExceptionCell)
{
if (bSize == 1)
return true;
int j = 1;
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.wSSBItemGrid[p])
if (m_pointsInstant.wSSBItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
else
return false;
}
if (1 == bSize)
return true;
else
{
int j = 1;
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
if (m_pointsInstant.wSSBItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
}
case STONE_INVENTORY:
{
WORD wCell = Cell.cell;
if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
return false;
iExceptionCell++;
if (m_pointsInstant.wSSSItemGrid[wCell])
{
if (m_pointsInstant.wSSSItemGrid[wCell] == iExceptionCell)
{
if (bSize == 1)
return true;
int j = 1;
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.wSSSItemGrid[p])
if (m_pointsInstant.wSSSItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
else
return false;
}
if (1 == bSize)
return true;
else
{
int j = 1;
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
if (m_pointsInstant.wSSSItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
}
case COSTUME_ARMOR_INVENTORY:
{
WORD wCell = Cell.cell;
++iExceptionCell;
if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
return false;
//iExceptionCell++;
if (m_pointsInstant.wSCAItemGrid[wCell])
{
if (m_pointsInstant.wSCAItemGrid[wCell] == iExceptionCell)
{
if (bSize == 1)
return true;
int j = 1;
WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
return false;
if (m_pointsInstant.wSCAItemGrid[p])
if (m_pointsInstant.wSCAItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
else
return false;
}
if (1 == bSize)
return true;
else
{
int j = 1;
WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
return false;
if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
if (m_pointsInstant.wSCAItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
}
case COSTUME_WEAPON_INVENTORY:
{
WORD wCell = Cell.cell;
++iExceptionCell;
if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
return false;
//iExceptionCell++;
if (m_pointsInstant.wSCWItemGrid[wCell])
{
if (m_pointsInstant.wSCWItemGrid[wCell] == iExceptionCell)
{
if (bSize == 1)
return true;
int j = 1;
WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
return false;
if (m_pointsInstant.wSCWItemGrid[p])
if (m_pointsInstant.wSCWItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
else
return false;
}
if (1 == bSize)
return true;
else
{
int j = 1;
WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);
do
{
int p = wCell + (5 * j);
if (p >= SPECIAL_INVENTORY_MAX_NUM)
return false;
if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
return false;
if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
if (m_pointsInstant.wSCWItemGrid[p] != iExceptionCell)
return false;
} while (++j < bSize);
return true;
}
}
#endif
#ifdef ENABLE_SWITCHBOT
case SWITCHBOT:
{
WORD wCell = Cell.cell;
if (wCell >= SWITCHBOT_SLOT_COUNT)
{
return false;
}
if (m_pointsInstant.pSwitchbotItems[wCell])
{
return false;
}
return true;
}
#endif
}
}

