summaryrefslogtreecommitdiff
path: root/src/itemshortcut.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/itemshortcut.cpp')
-rw-r--r--src/itemshortcut.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp
index a89da974..bea14864 100644
--- a/src/itemshortcut.cpp
+++ b/src/itemshortcut.cpp
@@ -61,14 +61,8 @@ void ItemShortcut::save()
{
for (int i = 0; i < SHORTCUT_ITEMS; i++)
{
- if (mItems[i])
- {
- config.setValue("shortcut" + toString(i), mItems[i]);
- }
- else
- {
- config.setValue("shortcut" + toString(i), -1);
- }
+ const int itemId = mItems[i] ? mItems[i] : -1;
+ config.setValue("shortcut" + toString(i), itemId);
}
}
@@ -77,9 +71,20 @@ void ItemShortcut::useItem(int index)
if (mItems[index])
{
Item *item = player_node->searchForItem(mItems[index]);
- if (item && item->getQuantity()) {
+ if (item && item->getQuantity())
+ {
// TODO: Fix this (index vs. pointer mismatch)
- //player_node->useItem(item);
+ /*
+ if (item->isEquipment()) {
+ if (item->isEquipped()) {
+ player_node->unequipItem(item);
+ } else {
+ player_node->equipItem(item);
+ }
+ } else {
+ player_node->useItem(item);
+ }
+ */
}
}
}