Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. int CItemBag::GetItemNewOption(ITEM_BAG_INFO* lpInfo) // OK
  2. {
  3. int count = 0;
  4.  
  5. int NewOption = 0;
  6. int randomOptions = (GetLargeRand()%2 + 1);
  7.  
  8. if(lpInfo->NewOption == 1) {
  9. while(true)
  10. {
  11. if(count >= randomOptions || count >= MAX_EXC_OPTION)
  12. {
  13. break;
  14. }
  15.  
  16. int value = 1 << (GetLargeRand()%MAX_EXC_OPTION);
  17.  
  18. if((NewOption & value) == 0)
  19. {
  20. NewOption |= value;
  21. count++;
  22. }
  23. }
  24. } else {
  25. while(true)
  26. {
  27. if(count >= lpInfo->NewOption || count >= MAX_EXC_OPTION)
  28. {
  29. break;
  30. }
  31.  
  32. int value = 1 << (GetLargeRand()%MAX_EXC_OPTION);
  33.  
  34. if((NewOption & value) == 0)
  35. {
  36. NewOption |= value;
  37. count++;
  38. }
  39. }
  40. }
  41.  
  42. return NewOption;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement