aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2018-03-16 22:26:45 -0400
committerPaul Gilbert2018-03-17 07:10:41 -0400
commitac98281d9d5e1c6a2fe1df7b580c90d0acf5553f (patch)
treedb0f1462c390ba4f0b5725d26809697b80020875 /engines/xeen
parentb7e8fff99e87092675fc0e48b66a5651782e2fdc (diff)
downloadscummvm-rg350-ac98281d9d5e1c6a2fe1df7b580c90d0acf5553f.tar.gz
scummvm-rg350-ac98281d9d5e1c6a2fe1df7b580c90d0acf5553f.tar.bz2
scummvm-rg350-ac98281d9d5e1c6a2fe1df7b580c90d0acf5553f.zip
XEEN: Don't let traps trigger more than once
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/interface.cpp26
1 files changed, 15 insertions, 11 deletions
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,