summaryrefslogtreecommitdiff
path: root/src/gui/equipmentwindow.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-04 14:45:20 -0700
committerIra Rice <irarice@gmail.com>2009-02-04 14:45:20 -0700
commit1e20fad127583d7832130ecf50ca90d190ede91b (patch)
treea83482c7457e0c2ca962dfd3f07394c275a0e6d8 /src/gui/equipmentwindow.cpp
parent35c4cb970f14989445828aefa4cf17f3260f9281 (diff)
downloadmana-client-1e20fad127583d7832130ecf50ca90d190ede91b.tar.gz
mana-client-1e20fad127583d7832130ecf50ca90d190ede91b.tar.bz2
mana-client-1e20fad127583d7832130ecf50ca90d190ede91b.tar.xz
mana-client-1e20fad127583d7832130ecf50ca90d190ede91b.zip
Forgot to check left clicking, as I assumed that it wouldn't break using
the same lookup code. This fixes left clicking on the last commit. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r--src/gui/equipmentwindow.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index f5ab604e..7630c53c 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -188,12 +188,18 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent)
// Checks if any of the presses were in the equip boxes.
for (int i = EQUIP_LEGS_SLOT; i < EQUIP_VECTOREND; i++)
{
- item = getItem(x, y);
+ item = (i != EQUIP_AMMO_SLOT) ?
+ mInventory->getItem(mEquipment->getEquipment(i)) :
+ mInventory->getItem(mEquipment->getArrows());
+ gcn::Rectangle tRect(mEquipBox[i].posX, mEquipBox[i].posY,
+ BOX_WIDTH, BOX_HEIGHT);
- if (item)
+ if (tRect.isPointInRect(x, y))
{
- mSelected = i;
- break;
+ if (item)
+ {
+ mSelected = i;
+ }
}
}
}