summaryrefslogtreecommitdiff
path: root/src/itemshortcut.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/itemshortcut.cpp')
-rw-r--r--src/itemshortcut.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp
index 88b04347..dfcbb3b6 100644
--- a/src/itemshortcut.cpp
+++ b/src/itemshortcut.cpp
@@ -20,13 +20,15 @@
*/
#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"
+
+#include "resources/iteminfo.h"
#include "utils/stringutils.h"
@@ -66,19 +68,19 @@ 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->getInfo().getEquippable())
{
if (item->isEquipped())
- Net::getInventoryHandler()->unequipItem(item);
+ item->doEvent(Event::DoUnequip);
else
- Net::getInventoryHandler()->equipItem(item);
+ item->doEvent(Event::DoEquip);
}
else
{
- Net::getInventoryHandler()->useItem(item);
+ item->doEvent(Event::DoUse);
}
}
}