From 25deaf3a35efac8e5103e193f5f68409a87047a0 Mon Sep 17 00:00:00 2001 From: richiesams Date: Sun, 18 Aug 2013 15:20:22 -0500 Subject: ZVISION: Reset MouseEvent globalStateValue's when clearing them --- engines/zvision/events.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/zvision') diff --git a/engines/zvision/events.cpp b/engines/zvision/events.cpp index bea476fa41..f382bb63e0 100644 --- a/engines/zvision/events.cpp +++ b/engines/zvision/events.cpp @@ -31,6 +31,7 @@ #include "zvision/cursor_manager.h" #include "zvision/render_manager.h" +#include "zvision/script_manager.h" #include "zvision/mouse_event.h" namespace ZVision { @@ -42,6 +43,7 @@ void ZVision::registerMouseEvent(const MouseEvent &event) { bool ZVision::removeMouseEvent(const uint32 key) { for (Common::List::iterator iter = _mouseEvents.begin(); iter != _mouseEvents.end(); iter++) { if ((*iter)._key == key) { + _scriptManager->setStateValue((*iter)._key, 0); _mouseEvents.erase(iter); return true; } @@ -51,6 +53,11 @@ bool ZVision::removeMouseEvent(const uint32 key) { } void ZVision::clearAllMouseEvents() { + // Clear the state values of all the events + for (Common::List::iterator iter = _mouseEvents.begin(); iter != _mouseEvents.end(); iter++) { + _scriptManager->setStateValue((*iter)._key, 0); + } + _mouseEvents.clear(); } -- cgit v1.2.3