diff options
-rw-r--r-- | src/gui/inventory.cpp | 9 | ||||
-rw-r--r-- | src/gui/inventory.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp index 864adf06..6b806f1d 100644 --- a/src/gui/inventory.cpp +++ b/src/gui/inventory.cpp @@ -99,11 +99,12 @@ int TmwInventory::increase_quantity(int index, int quantity) { return 0; } -int TmwInventory::useItem(int idnum) { - printf("Use item %i\n",idnum); +int TmwInventory::use_item(int index, int id) { WFIFOW(0) = net_w_value(0x00a7); - WFIFOW(2) = net_w_value(idnum); - WFIFOSET(4); + WFIFOW(2) = net_w_value(index); + WFIFOL(4) = net_l_value(id); + // Note: id is dest of item, usually player_node->account_ID + WFIFOSET(8); while((out_size>0))flush(); return 0; diff --git a/src/gui/inventory.h b/src/gui/inventory.h index 21a958ab..653d99db 100644 --- a/src/gui/inventory.h +++ b/src/gui/inventory.h @@ -59,7 +59,7 @@ class TmwInventory{ int remove_item(int id); // remove a item int change_quantity(int index, int quantity); // change number of a item int increase_quantity(int index, int quantity); // increase quantity of a item - int useItem(int idnum); + int use_item(int index, int id); //END API private: itemHolder items[INVENTORY_SIZE]; // this is the holder of items |