src/main.c

changeset 46
4dcfb4c58b6d
parent 35
6c64b7a073af
child 47
d726e4b46c33
     1.1 --- a/src/main.c	Thu Apr 17 11:55:36 2014 +0200
     1.2 +++ b/src/main.c	Thu Apr 17 12:16:14 2014 +0200
     1.3 @@ -179,15 +179,22 @@
     1.4      }
     1.5      atexit(leavescr);
     1.6      
     1.7 +    int exitcode;
     1.8      if (settings.singlemachine) {
     1.9          game_start_singlemachine(&settings);
    1.10 +        exitcode = EXIT_SUCCESS;
    1.11      } else {
    1.12 -        int exitcode = is_server(&settings) ?
    1.13 +        exitcode = is_server(&settings) ?
    1.14              server_run(&settings) : client_run(&settings);
    1.15 -        
    1.16 -        if (exitcode != EXIT_SUCCESS) {
    1.17 -            cbreak(); getch();
    1.18 -        }
    1.19      }
    1.20 +    
    1.21 +    mvaddstr(getmaxy(stdscr)-1, 0,
    1.22 +        "Game has ended. Press any key to leave...");
    1.23 +    refresh();
    1.24 +    cbreak();
    1.25 +    flushinp();
    1.26 +    getch();
    1.27 +    
    1.28 +    return exitcode;
    1.29  }
    1.30  

mercurial