aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-12-16 09:44:04 +0000
committerTorbjörn Andersson2007-12-16 09:44:04 +0000
commitbd7bef0fe662ab26ffb2fd979cdaabc4aa27cc47 (patch)
tree3fa36094a4a55a8eb7c10a2927adfb449b673830
parentaa96ec99400b76b0bf9cc0efc00d6cf6c2984c2b (diff)
downloadscummvm-rg350-bd7bef0fe662ab26ffb2fd979cdaabc4aa27cc47.tar.gz
scummvm-rg350-bd7bef0fe662ab26ffb2fd979cdaabc4aa27cc47.tar.bz2
scummvm-rg350-bd7bef0fe662ab26ffb2fd979cdaabc4aa27cc47.zip
Clear the EXIT_CLICK_ID variable when entering a new room. Otherwise, if an
exit warps back to the same room, clicking on the same exit again is misinterpreted as a double-click, and that only works if we're already walking towards that exit. Otherwise, the game will hang. This fixed bug #1851502 ("SWORD2: Black-out in Forest"). svn-id: r29876
-rw-r--r--engines/sword2/layers.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/sword2/layers.cpp b/engines/sword2/layers.cpp
index 34ee395f16..6f8ed2f0b7 100644
--- a/engines/sword2/layers.cpp
+++ b/engines/sword2/layers.cpp
@@ -63,6 +63,13 @@ void Screen::initBackground(int32 res, int32 new_palette) {
debug(1, "CHANGED TO LOCATION \"%s\"", _vm->_resman->fetchName(res));
+ // We have to clear this. Otherwise, if an exit warps back to the same
+ // room (e.g. the jungle maze), clicking on the same exit again will be
+ // misinterpreted as a double-click, and that only works if we're
+ // actually walking towards that exit. Otherwise, the game would hang.
+
+ _vm->_logic->writeVar(EXIT_CLICK_ID, 0);
+
// if last screen was using a shading mask (see below)
if (_thisScreen.mask_flag) {
if (closeLightMask() != RD_OK)