src/main.c

changeset 46
4dcfb4c58b6d
parent 35
6c64b7a073af
child 47
d726e4b46c33
equal deleted inserted replaced
45:e14a1d9aa91d 46:4dcfb4c58b6d
177 endwin(); 177 endwin();
178 return EXIT_FAILURE; 178 return EXIT_FAILURE;
179 } 179 }
180 atexit(leavescr); 180 atexit(leavescr);
181 181
182 int exitcode;
182 if (settings.singlemachine) { 183 if (settings.singlemachine) {
183 game_start_singlemachine(&settings); 184 game_start_singlemachine(&settings);
185 exitcode = EXIT_SUCCESS;
184 } else { 186 } else {
185 int exitcode = is_server(&settings) ? 187 exitcode = is_server(&settings) ?
186 server_run(&settings) : client_run(&settings); 188 server_run(&settings) : client_run(&settings);
187 189 }
188 if (exitcode != EXIT_SUCCESS) { 190
189 cbreak(); getch(); 191 mvaddstr(getmaxy(stdscr)-1, 0,
190 } 192 "Game has ended. Press any key to leave...");
191 } 193 refresh();
192 } 194 cbreak();
193 195 flushinp();
196 getch();
197
198 return exitcode;
199 }
200

mercurial