diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-04 15:19:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-04 15:19:53 +0300 |
commit | a553b3cda91aa095d88e22abcaa81701c2894334 (patch) | |
tree | cb44d56a66896fdbf4eaf9673901ee9cf3a60a73 /src/itemshortcut.cpp | |
parent | 343809fe458a08bf96fe4f537db2d81d7523632e (diff) | |
download | manaverse-a553b3cda91aa095d88e22abcaa81701c2894334.tar.gz manaverse-a553b3cda91aa095d88e22abcaa81701c2894334.tar.bz2 manaverse-a553b3cda91aa095d88e22abcaa81701c2894334.tar.xz manaverse-a553b3cda91aa095d88e22abcaa81701c2894334.zip |
move equip/unequip/use calls into playerinfo.
Diffstat (limited to 'src/itemshortcut.cpp')
-rw-r--r-- | src/itemshortcut.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
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); } } } |