From 0058049e3224b10d1d8a074d70eb092a9a780fd3 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 29 Jan 2007 17:59:28 +0000 Subject: Added a proper workaround for the race condition in the script when opening the notepad, which was apparently causing bug #1621089 svn-id: r25255 --- engines/gob/inter_v2.cpp | 4 +++- engines/gob/util.cpp | 6 ++++++ engines/gob/util.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'engines/gob') diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 63c451dedc..f605b11720 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -2240,7 +2240,9 @@ void Inter_v2::o2_totSub(void) { totFile[i] = 0; } - _vm->_util->longDelay(100); + // WORKAROUND: There is a race condition in the script when opening the notepad + if (!scumm_stricmp(totFile, "edit")) + _vm->_util->forceMouseUp(); flags = (byte) *_vm->_global->_inter_execPtr++; _vm->_game->totSub(flags, totFile); } diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 47a5ce076d..f7c5fa9202 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -488,4 +488,10 @@ void Util::waitMouseRelease(char drawMouse) { } void Util::keyboard_release(void) {;} + +void Util::forceMouseUp(void) { + _vm->_game->_mouseButtons = 0; + _mouseButtons = 0; +} + } // End of namespace Gob diff --git a/engines/gob/util.h b/engines/gob/util.h index 1b9b40b72e..701d295f52 100644 --- a/engines/gob/util.h +++ b/engines/gob/util.h @@ -83,6 +83,7 @@ public: static void deleteList(List * list); static void prepareStr(char *str); void waitMouseRelease(char drawMouse); + void forceMouseUp(void); static const char trStr1[]; static const char trStr2[]; -- cgit v1.2.3