Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. void CHARACTER::RemoveSpecifyItem(DWORD vnum, DWORD count)
  2. {
  3.     if (0 == count)
  4.         return;
  5.  
  6.     for (UINT i = 0; i < INVENTORY_MAX_NUM; ++i)
  7.     {
  8.         if (NULL == GetInventoryItem(i))
  9.             continue;
  10.  
  11.         if (GetInventoryItem(i)->GetVnum() != vnum)
  12.             continue;
  13.  
  14.         //개인 상점에 등록된 물건이면 넘어간다. (개인 상점에서 판매될때 이 부분으로 들어올 경우 문제!)
  15.         if(m_pkMyShop)
  16.         {
  17.             bool isItemSelling = m_pkMyShop->IsSellingItem(GetInventoryItem(i)->GetID());
  18.             if (isItemSelling)
  19.                 continue;
  20.         }
  21.  
  22.         if (vnum >= 80003 && vnum <= 80007)
  23.             LogManager::instance().GoldBarLog(GetPlayerID(), GetInventoryItem(i)->GetID(), QUEST, "RemoveSpecifyItem");
  24.  
  25.         if (count >= GetInventoryItem(i)->GetCount())
  26.         {
  27.             count -= GetInventoryItem(i)->GetCount();
  28.             GetInventoryItem(i)->SetCount(0);
  29.  
  30.             if (0 == count)
  31.                 return;
  32.         }
  33.         else
  34.         {
  35.             GetInventoryItem(i)->SetCount(GetInventoryItem(i)->GetCount() - count);
  36.             return;
  37.         }
  38.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement