Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. bool Inventory::decreaseCountItem( unsigned int index, unsigned int count, bool& deleteFlag )
  2. {
  3.     CItem* pItem = buffer_[index];
  4.     int newCount = pItem->m_count - count;
  5.     if (newCount < 0) // ?? ??? ???
  6.     {
  7.         newCount = 0;
  8.         deleteFlag = true;
  9.         LOG_ERROR("not enought item count. now count[%d], delete count[%d]", pItem->Count(), count);
  10.     //ch->m_desc->Close("invalid packet item count");
  11.         return deleteItem(index);
  12.     }
  13.  
  14.     if (newCount == 0) // ??? ??? 0? ??, ???? ?????
  15.     {
  16.         deleteFlag = true;
  17.         return deleteItem(index);
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement