diff options
Diffstat (limited to 'engines/hugo/mouse.cpp')
-rw-r--r-- | engines/hugo/mouse.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp index 4ef3db3e2b..4b874756a0 100644 --- a/engines/hugo/mouse.cpp +++ b/engines/hugo/mouse.cpp @@ -160,7 +160,6 @@ void MouseHandler::processRightClick(const int16 objId, const int16 cx, const in return; int16 inventObjId = _vm->_inventory->getInventoryObjId(); - bool foundFl = false; // TRUE if route found to object // Check if this was over iconbar if ((_vm->_inventory->getInventoryState() == kInventoryActive) && (cy < kInvDy + kDibOffY)) { // Clicked over iconbar object if (inventObjId == -1) @@ -172,12 +171,14 @@ void MouseHandler::processRightClick(const int16 objId, const int16 cx, const in } else { // Clicked over viewport object Object *obj = &_vm->_object->_objects[objId]; int16 x, y; - switch (obj->_viewx) { // Where to walk to - case -1: // Walk to object position + switch (obj->_viewx) { // Where to walk to + case -1: { // Walk to object position + bool foundFl = false; if (_vm->_object->findObjectSpace(obj, &x, &y)) - foundFl = _vm->_route->startRoute(kRouteGet, objId, x, y); + foundFl = _vm->_route->startRoute(kRouteGet, objId, x, y); // TRUE if route found to object if (!foundFl) // Can't get there, try to use from here _vm->_object->useObject(objId); + } break; case 0: // Immediate use _vm->_object->useObject(objId); // Pick up or use object |