Fix a bug introduced when reworking the timer and input system.
authorMatthew Mondor <mmondor@pulsar-zone.net>
Wed, 12 Apr 2023 09:23:07 +0000 (09:23 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Wed, 12 Apr 2023 09:23:07 +0000 (09:23 +0000)
It caused the game to return in pause mode repeatedly once enabled.

pacman.c

index 093f20a..79fc604 100755 (executable)
--- a/pacman.c
+++ b/pacman.c
@@ -472,7 +472,7 @@ void GetInput() {
 
     case 'p': case 'P':                            //Pause game
         PauseGame();
-//      chtmp = getch();            //Update buffered input
+        chtmp = getch();            //Update buffered input
         break;
 
     case 'q': case 'Q':                            //End program
@@ -841,6 +841,7 @@ void PauseGame() {
     wrefresh(win);
     
     //And wait until key is pressed
+    (void)flushinp();
     (void)curs_set(1);
     (void)nodelay(stdscr, FALSE);
     do {