summaryrefslogtreecommitdiff
path: root/src/gui/windows/inventorywindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r--src/gui/windows/inventorywindow.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 99d4d4954..0cc9b4e0e 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -358,11 +358,11 @@ void InventoryWindow::action(const gcn::ActionEvent &event)
if (eventId == "use")
{
- PlayerInfo::useEquipItem(item);
+ PlayerInfo::useEquipItem(item, true);
}
if (eventId == "equip")
{
- PlayerInfo::useEquipItem2(item);
+ PlayerInfo::useEquipItem2(item, true);
}
else if (eventId == "drop")
{
@@ -524,19 +524,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
}
else
{
- if (item->isEquipment())
- {
- if (item->isEquipped())
- PlayerInfo::unequipItem(item);
- else
- PlayerInfo::equipItem(item);
- }
- else
- {
- if (PlayerInfo::isItemProtected(item->getId()))
- return;
- PlayerInfo::useItem(item);
- }
+ PlayerInfo::useEquipItem(item, true);
}
}
else