diff options
Diffstat (limited to 'src/itemshortcut.cpp')
-rw-r--r-- | src/itemshortcut.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp index 88b04347..eaf16889 100644 --- a/src/itemshortcut.cpp +++ b/src/itemshortcut.cpp @@ -20,10 +20,11 @@ */ #include "configuration.h" +#include "event.h" #include "inventory.h" #include "item.h" #include "itemshortcut.h" -#include "localplayer.h" +#include "playerinfo.h" #include "net/inventoryhandler.h" #include "net/net.h" @@ -66,20 +67,18 @@ void ItemShortcut::useItem(int index) { if (mItems[index]) { - Item *item = player_node->getInventory()->findItem(mItems[index]); + Item *item = PlayerInfo::getInventory()->findItem(mItems[index]); if (item && item->getQuantity()) { if (item->isEquipment()) { if (item->isEquipped()) - Net::getInventoryHandler()->unequipItem(item); + item->doEvent("doUnequip"); else - Net::getInventoryHandler()->equipItem(item); + item->doEvent("doEquip"); } else - { - Net::getInventoryHandler()->useItem(item); - } + item->doEvent("doUse"); } } } |