From bd7bef0fe662ab26ffb2fd979cdaabc4aa27cc47 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 16 Dec 2007 09:44:04 +0000 Subject: 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 --- engines/sword2/layers.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/sword2/layers.cpp') 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) -- cgit v1.2.3