From 1e20fad127583d7832130ecf50ca90d190ede91b Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Wed, 4 Feb 2009 14:45:20 -0700 Subject: 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 --- src/gui/equipmentwindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/gui/equipmentwindow.cpp') 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; + } } } } -- cgit v1.2.3-70-g09d2