From a553b3cda91aa095d88e22abcaa81701c2894334 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 4 Oct 2013 15:19:53 +0300 Subject: move equip/unequip/use calls into playerinfo. --- src/itemshortcut.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/itemshortcut.cpp') diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp index 5ef762de8..7356ff0e7 100644 --- a/src/itemshortcut.cpp +++ b/src/itemshortcut.cpp @@ -133,20 +133,7 @@ void ItemShortcut::useItem(const int index) const { const Item *const item = inv->findItem(itemId, itemColor); if (item && item->getQuantity()) - { - if (item->isEquipment()) - { - if (item->isEquipped()) - Net::getInventoryHandler()->unequipItem(item); - else - Net::getInventoryHandler()->equipItem(item); - } - else - { - if (!PlayerInfo::isItemProtected(item->getId())) - Net::getInventoryHandler()->useItem(item); - } - } + PlayerInfo::useEquipItem(item); } else if (itemId < SKILL_MIN_ID && spellManager) { @@ -174,7 +161,7 @@ void ItemShortcut::equipItem(const int index) const if (item->isEquipment()) { if (!item->isEquipped()) - Net::getInventoryHandler()->equipItem(item); + PlayerInfo::equipItem(item); } } } @@ -194,7 +181,7 @@ void ItemShortcut::unequipItem(const int index) const if (item->isEquipment()) { if (item->isEquipped()) - Net::getInventoryHandler()->unequipItem(item); + PlayerInfo::unequipItem(item); } } } -- cgit v1.2.3-60-g2f50