summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-10 02:16:33 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-10 02:16:33 +0300
commitdd010b773630776a2152d09e27d6f1e980d60400 (patch)
treea68e9e5b9697c0e11bc22d1956579dfd24ab98d5
parentd811b764c763bb4ed48dc1d2444c47a1c28e94a5 (diff)
downloadplus-dd010b773630776a2152d09e27d6f1e980d60400.tar.gz
plus-dd010b773630776a2152d09e27d6f1e980d60400.tar.bz2
plus-dd010b773630776a2152d09e27d6f1e980d60400.tar.xz
plus-dd010b773630776a2152d09e27d6f1e980d60400.zip
Fix random key press loses.
-rw-r--r--src/game.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e2a401d80..042bd2423 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -710,6 +710,7 @@ void Game::handleInput()
if (joystick)
joystick->update();
+ bool wasDown(false);
// Events
SDL_Event event;
while (SDL_PollEvent(&event))
@@ -722,6 +723,7 @@ void Game::handleInput()
// Keyboard events (for discontinuous keys)
if (event.type == SDL_KEYDOWN)
{
+ wasDown = true;
gcn::Window *requestedWindow = nullptr;
if (setupWindow && setupWindow->isVisible() &&
@@ -1585,7 +1587,7 @@ void Game::handleInput()
joyAttack = true;
if ((((player_node->getAttackType() == 0
- && player_node->getFollow().empty()) || event.type == SDL_KEYDOWN)
+ && player_node->getFollow().empty()) || wasDown)
|| joyAttack) && mValidSpeed)
{
// Attacking monsters