Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. case INVENTORY:
  2. {
  3. short bCell = Cell.cell;
  4.  
  5. // bItemCell은 0이 false임을 나타내기 위해 + 1 해서 처리한다.
  6. // 따라서 iExceptionCell에 1을 더해 비교한다.
  7. ++iExceptionCell;
  8.  
  9. if (Cell.IsBeltInventoryPosition())
  10. {
  11. LPITEM beltItem = GetWear(WEAR_BELT);
  12.  
  13. if (NULL == beltItem)
  14. return false;
  15.  
  16. if (false == CBeltInventoryHelper::IsAvailableCell(bCell - BELT_INVENTORY_SLOT_START, beltItem->GetValue(0)))
  17. return false;
  18.  
  19. if (m_pointsInstant.bItemGrid[bCell])
  20. {
  21. if (m_pointsInstant.bItemGrid[bCell] == (short)iExceptionCell)
  22. return true;
  23.  
  24. return false;
  25. }
  26.  
  27. if (bSize == 1)
  28. return true;
  29.  
  30. }
  31. else if (bCell >= INVENTORY_MAX_NUM)
  32. return false;
  33.  
  34. if (m_pointsInstant.bItemGrid[bCell])
  35. {
  36. if (m_pointsInstant.bItemGrid[bCell] == (short)iExceptionCell)
  37. {
  38. if (bSize == 1)
  39. return true;
  40.  
  41. int j = 1;
  42. // BYTE bPage = bCell / (INVENTORY_MAX_NUM / 2);
  43. short bPage = bCell / (INVENTORY_MAX_NUM / 4);
  44.  
  45. do
  46. {
  47. short p = bCell + (5 * j);
  48.  
  49. if (p >= INVENTORY_MAX_NUM)
  50. return false;
  51.  
  52. // if (p / (INVENTORY_MAX_NUM / 2) != bPage)
  53. if (p / (INVENTORY_MAX_NUM / 4) != bPage)
  54. return false;
  55.  
  56. if (m_pointsInstant.bItemGrid[p])
  57. if (m_pointsInstant.bItemGrid[p] != iExceptionCell)
  58. return false;
  59. }
  60. while (++j < bSize);
  61.  
  62. return true;
  63. }
  64. else
  65. return false;
  66. }
  67.  
  68. // 크기가 1이면 한칸을 차지하는 것이므로 그냥 리턴
  69. if (1 == bSize)
  70. return true;
  71. else
  72. {
  73. int j = 1;
  74. short bPage = bCell / (INVENTORY_MAX_NUM / 4);
  75.  
  76. do
  77. {
  78. short p = bCell + (5 * j);
  79.  
  80. if (p >= INVENTORY_MAX_NUM)
  81. return false;
  82.  
  83. if (p / (INVENTORY_MAX_NUM / 4) != bPage)
  84. return false;
  85.  
  86. if (m_pointsInstant.bItemGrid[p])
  87. if (m_pointsInstant.bItemGrid[p] != iExceptionCell)
  88. return false;
  89. }
  90. while (++j < bSize);
  91.  
  92. return true;
  93. }
  94. }
  95. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement