X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameloop.cpp;h=78b4a88e7cc94ec181ed8794c72a3ba8e2bf731d;hb=cdb879de1ef50e2d2fb1aead922775d202ddd114;hp=6ea6f4a6a095d12b19ccc24af78516b3f62484a5;hpb=35c6b7570656fa062e243dfd3008a14213b338f5;p=supertux.git diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 6ea6f4a6a..78b4a88e7 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -188,6 +188,7 @@ GameSession::on_escape_press() else if (!Menu::current()) { Menu::set_current(game_menu); + st_pause_ticks_start(); } } @@ -217,7 +218,8 @@ GameSession::process_events() if (Menu::current()) { Menu::current()->event(event); - st_pause_ticks_start(); + if(!Menu::current()) + st_pause_ticks_stop(); } switch(event.type) @@ -259,7 +261,18 @@ GameSession::process_events() if (Menu::current()) { Menu::current()->event(event); - st_pause_ticks_start(); + if(!Menu::current()) + st_pause_ticks_stop(); + + /* Tell Tux that the keys are all down, otherwise + it could have nasty bugs, like going allways to the right + or whatever that key does */ + Player& tux = *world->get_tux(); + tux.key_event((SDLKey)keymap.jump, UP); + tux.key_event((SDLKey)keymap.duck, UP); + tux.key_event((SDLKey)keymap.left, UP); + tux.key_event((SDLKey)keymap.right, UP); + tux.key_event((SDLKey)keymap.fire, UP); } else {