From ac98281d9d5e1c6a2fe1df7b580c90d0acf5553f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 16 Mar 2018 22:26:45 -0400 Subject: XEEN: Don't let traps trigger more than once --- engines/xeen/interface.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'engines/xeen') diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 3d9f05b5a2..b994a99713 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -258,20 +258,24 @@ void Interface::perform() { Spells &spells = *_vm->_spells; const Common::Rect WAIT_BOUNDS(8, 8, 224, 140); - events.updateGameCounter(); - draw3d(true); - - // Wait for a frame or a user event do { - events.pollEventsAndWait(); - checkEvents(_vm); + // Draw the next frame + events.updateGameCounter(); + draw3d(true); - if (events._leftButton && WAIT_BOUNDS.contains(events._mousePos)) - _buttonValue = Common::KEYCODE_SPACE; - } while (!_buttonValue && events.timeElapsed() < 1 && !_vm->_party->_partyDead); + // Wait for a frame or a user event + _buttonValue = 0; + do { + events.pollEventsAndWait(); + if (party._partyDead) + return; - if (!_buttonValue && !_vm->_party->_partyDead) - return; + if (events._leftButton && WAIT_BOUNDS.contains(events._mousePos)) + _buttonValue = Common::KEYCODE_SPACE; + else + checkEvents(g_vm); + } while (!_buttonValue && events.timeElapsed() < 1); + } while (!_buttonValue); if (_buttonValue == Common::KEYCODE_SPACE) { int lookupId = map.mazeLookup(party._mazePosition, -- cgit v1.2.3