Advertisement
Kapa3a

Fix Quick slot

Nov 29th, 2023
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | Source Code | 0 0
  1. 3.Rezolvare:
  2. 3.1.input_main.cpp
  3. //Cauta functia:
  4. void CInputMain::QuickslotAdd(LPCHARACTER ch, const char * data)
  5. //Inlocuieste-o cu:
  6. void CInputMain::QuickslotAdd(LPCHARACTER ch, const char * data)
  7. {
  8.    struct command_quickslot_add * pinfo = (struct command_quickslot_add *) data;
  9. #ifdef ENABLE_FIX_QUICK_SLOT  
  10.    if(pinfo->slot.type == QUICKSLOT_TYPE_ITEM)
  11.    {
  12.       LPITEM item = NULL;
  13.      
  14.       TItemPos srcCell(INVENTORY, pinfo->slot.pos);
  15.      
  16.       if (!(item = ch->GetItem(srcCell)))
  17.          return;
  18.      
  19.       if (item->GetType() != ITEM_USE && item->GetType() != ITEM_QUEST)
  20.          return;
  21.    }
  22. #endif
  23.    
  24.    ch->SetQuickslot(pinfo->pos, pinfo->slot);
  25. }
  26.  
  27.  
  28. 3.2.service.h
  29. //Adauga:
  30. #define ENABLE_FIX_QUICK_SLOT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement