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 |