diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 23:47:02 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 23:47:02 +0100 |
commit | fa2f3ac593a792c32095c2e885665ec91bb4019d (patch) | |
tree | f44aee845f0229dfcc6b2ad3c74613e0352f36c2 /src/itemshortcut.cpp | |
parent | 07f7d52f661a74e6d0c780ca53e724651e3dcc48 (diff) | |
parent | 40edf4e91558cffd83d9015a2cf4a16360e27855 (diff) | |
download | mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.gz mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.bz2 mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.xz mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.zip |
Merged with Aethyra master as of 2009-02-09
Conflicts:
A lot of files...
Diffstat (limited to 'src/itemshortcut.cpp')
-rw-r--r-- | src/itemshortcut.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp index 7bfbc88e..3404b0e3 100644 --- a/src/itemshortcut.cpp +++ b/src/itemshortcut.cpp @@ -33,9 +33,8 @@ ItemShortcut::ItemShortcut(): mItemSelected(-1) { for (int i = 0; i < SHORTCUT_ITEMS; i++) - { mItems[i] = -1; - } + load(); } @@ -51,9 +50,7 @@ void ItemShortcut::load() int itemId = (int) config.getValue("shortcut" + toString(i), -1); if (itemId != -1) - { mItems[i] = itemId; - } } } @@ -73,13 +70,15 @@ void ItemShortcut::useItem(int index) Item *item = player_node->getInventory()->findItem(mItems[index]); if (item && item->getQuantity()) { - if (item->isEquipment()) { - if (item->isEquipped()) { + if (item->isEquipment()) + { + if (item->isEquipped()) player_node->unequipItem(item); - } else { + else player_node->equipItem(item); - } - } else { + } + else + { player_node->useItem(item); } } |