diff options
author | Paul Gilbert | 2015-08-04 19:35:51 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-08-04 19:35:51 -0400 |
commit | ed4ae8c863e2de2143453c770f492ddf9ba1689c (patch) | |
tree | fb8f7aa21c846d0b4eae0ae18f223651365706cd | |
parent | 109ee5ba7aeae9c3816d044e961eef4fb1a3ed64 (diff) | |
download | scummvm-rg350-ed4ae8c863e2de2143453c770f492ddf9ba1689c.tar.gz scummvm-rg350-ed4ae8c863e2de2143453c770f492ddf9ba1689c.tar.bz2 scummvm-rg350-ed4ae8c863e2de2143453c770f492ddf9ba1689c.zip |
SHERLOCK: RT: Properly wait for press when dart game ends
-rw-r--r-- | engines/sherlock/events.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_darts.cpp | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index 204db8bd15..758ba12b6a 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -325,7 +325,7 @@ bool Events::delay(uint32 time, bool interruptable) { while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) { pollEventsAndWait(); - if (interruptable && (kbHit() || _pressed)) { + if (interruptable && (kbHit() || _mouseButtons)) { clearEvents(); return false; } diff --git a/engines/sherlock/tattoo/tattoo_darts.cpp b/engines/sherlock/tattoo/tattoo_darts.cpp index 844697a518..cb4b52b01a 100644 --- a/engines/sherlock/tattoo/tattoo_darts.cpp +++ b/engines/sherlock/tattoo/tattoo_darts.cpp @@ -126,6 +126,7 @@ void Darts::playDarts(GameType gameType) { // it entirely if you don't want to play all the way through it if (_escapePressed) { gameOver = true; + done = true; playerNum = 0; } @@ -219,7 +220,7 @@ void Darts::playDarts(GameType gameType) { if ((playerNum == 0 && _compPlay == 1) || _compPlay == 0 || done) { if (_escapePressed) { done = true; - idx = 10; + break; } } else { events.wait(20); @@ -241,6 +242,13 @@ void Darts::playDarts(GameType gameType) { } } + // Wait for a keypress + do { + events.pollEventsAndWait(); + events.setButtonState(); + } while (!_vm->shouldQuit() && !events.kbHit() && !events._pressed); + events.clearEvents(); + closeDarts(); screen.fadeToBlack(); screen.setFont(oldFontType); |