src/main.c

changeset 46
4dcfb4c58b6d
parent 35
6c64b7a073af
child 47
d726e4b46c33
--- a/src/main.c	Thu Apr 17 11:55:36 2014 +0200
+++ b/src/main.c	Thu Apr 17 12:16:14 2014 +0200
@@ -179,15 +179,22 @@
     }
     atexit(leavescr);
     
+    int exitcode;
     if (settings.singlemachine) {
         game_start_singlemachine(&settings);
+        exitcode = EXIT_SUCCESS;
     } else {
-        int exitcode = is_server(&settings) ?
+        exitcode = is_server(&settings) ?
             server_run(&settings) : client_run(&settings);
-        
-        if (exitcode != EXIT_SUCCESS) {
-            cbreak(); getch();
-        }
     }
+    
+    mvaddstr(getmaxy(stdscr)-1, 0,
+        "Game has ended. Press any key to leave...");
+    refresh();
+    cbreak();
+    flushinp();
+    getch();
+    
+    return exitcode;
 }
 

mercurial