Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case INVENTORY:
- {
- short 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] == (short)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] == (short)iExceptionCell)
- {
- if (bSize == 1)
- return true;
- int j = 1;
- // BYTE bPage = bCell / (INVENTORY_MAX_NUM / 2);
- short bPage = bCell / (INVENTORY_MAX_NUM / 4);
- do
- {
- short p = bCell + (5 * j);
- if (p >= INVENTORY_MAX_NUM)
- return false;
- // if (p / (INVENTORY_MAX_NUM / 2) != bPage)
- if (p / (INVENTORY_MAX_NUM / 4) != 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;
- short bPage = bCell / (INVENTORY_MAX_NUM / 4);
- do
- {
- short p = bCell + (5 * j);
- if (p >= INVENTORY_MAX_NUM)
- return false;
- if (p / (INVENTORY_MAX_NUM / 4) != bPage)
- return false;
- if (m_pointsInstant.bItemGrid[p])
- if (m_pointsInstant.bItemGrid[p] != iExceptionCell)
- return false;
- }
- while (++j < bSize);
- return true;
- }
- }
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement