From a5a094b6bdf1dd61f270e60068c42d9f62b8c447 Mon Sep 17 00:00:00 2001 From: Borja Lorente Date: Sun, 10 Jul 2016 23:03:26 +0200 Subject: MACVENTURE: Begin fixing second inventory problem --- engines/macventure/gui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/macventure') diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 880ec286d0..1f07e7c7c4 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -830,7 +830,8 @@ WindowReference Gui::findWindowAtPoint(Common::Point point) { Common::List::iterator it; for (it = _windowData->begin(); it != _windowData->end(); it++) { if (it->bounds.contains(point) && it->refcon != kDiplomaWindow) { //HACK, diploma should be cosnidered - return it->refcon; + if (findWindow(it->refcon)->isActive()) + return it->refcon; } } return kNoWindow; @@ -957,6 +958,7 @@ void Gui::selectDraggable(ObjID child, WindowReference origin, Common::Point sta void Gui::handleDragRelease(Common::Point pos, bool shiftPressed, bool isDoubleClick) { WindowReference destinationWindow = findWindowAtPoint(pos); + if (destinationWindow == kNoWindow) return; if (_draggedObj.id != 0) { if (_draggedObj.hasMoved) { ObjID destObject = getWindowData(destinationWindow).objRef; @@ -1260,6 +1262,7 @@ bool Gui::processInventoryEvents(WindowClick click, Common::Event & event) { // Find the appropriate window WindowReference ref = findWindowAtPoint(event.mouse); + if (ref == kNoWindow) return false; Graphics::MacWindow *win = findWindow(ref); WindowData &data = findWindowData((WindowReference) ref); ObjID child; -- cgit v1.2.3