diff options
Diffstat (limited to 'engines/hugo/mouse.cpp')
-rw-r--r-- | engines/hugo/mouse.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp index ae286c8afb..4ef3db3e2b 100644 --- a/engines/hugo/mouse.cpp +++ b/engines/hugo/mouse.cpp @@ -45,7 +45,8 @@ namespace Hugo { -MouseHandler::MouseHandler(HugoEngine *vm) : _vm(vm), _hotspots(0) { +MouseHandler::MouseHandler(HugoEngine *vm) : _vm(vm) { + _hotspots = nullptr; _leftButtonFl = false; _rightButtonFl = false; _jumpExitFl = false; // Can't jump to a screen exit @@ -83,6 +84,7 @@ void MouseHandler::setMouseY(int y) { void MouseHandler::freeHotspots() { free(_hotspots); + _hotspots = nullptr; } bool MouseHandler::getJumpExitFl() const { @@ -169,7 +171,7 @@ void MouseHandler::processRightClick(const int16 objId, const int16 cx, const in _vm->_object->useObject(objId); // Use status.objid on object } else { // Clicked over viewport object Object *obj = &_vm->_object->_objects[objId]; - int16 x = 0, y = 0; + int16 x, y; switch (obj->_viewx) { // Where to walk to case -1: // Walk to object position if (_vm->_object->findObjectSpace(obj, &x, &y)) |