Advertisement
Guest User

Untitled

a guest
Sep 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. iloligemov.cpp:
  2.  
  3.  
  4.  
  5. bool CExchange::CheckSpace()
  6. {
  7. static CGrid s_grid1(5, INVENTORY_MAX_NUM / 5 / 4); // inven page 1 9 Rows a 5 Columns
  8. static CGrid s_grid2(5, INVENTORY_MAX_NUM / 5 / 4); // inven page 2 9 Rows a 5 Columns
  9. static CGrid s_grid3(5, INVENTORY_MAX_NUM / 5 / 4); // inven page 3 9 Rows a 5 Columns
  10. static CGrid s_grid4(5, INVENTORY_MAX_NUM / 5 / 4); // inven page 4 9 Rows a 5 Columns
  11.  
  12. s_grid1.Clear();
  13. s_grid2.Clear();
  14. s_grid3.Clear();
  15. s_grid4.Clear();
  16.  
  17. LPCHARACTER victim = GetCompany()->GetOwner();
  18. LPITEM item;
  19.  
  20. int i;
  21.  
  22. const int perPageSlotCount = INVENTORY_MAX_NUM / 4;
  23.  
  24. for (i = 0; i < INVENTORY_MAX_NUM; ++i) {
  25. if (!(item = victim->GetInventoryItem(i)))
  26. continue;
  27.  
  28. BYTE itemSize = item->GetSize();
  29.  
  30. if (i < perPageSlotCount) //
  31. s_grid1.Put(i, 1, itemSize);
  32. else if (i < perPageSlotCount * 2)
  33. s_grid2.Put(i - perPageSlotCount, 1, itemSize);
  34. else if (i < perPageSlotCount * 3)
  35. s_grid3.Put(i - perPageSlotCount * 2, 1, itemSize);
  36. else
  37. s_grid4.Put(i - perPageSlotCount * 3, 1, itemSize);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement