| 387 | } |
| 388 | |
| 389 | static void _launch_game_loop() |
| 390 | { |
| 391 | bool game_ended = false; |
| 392 | do |
| 393 | { |
| 394 | try |
| 395 | { |
| 396 | game_ended = false; |
| 397 | _launch_game(); |
| 398 | } |
| 399 | catch (const game_ended_condition &ge) |
| 400 | { |
| 401 | game_ended = true; |
| 402 | crawl_state.last_game_exit = ge; |
| 403 | _reset_game(); |
| 404 | |
| 405 | // Don't re-enter the Sprint menu with restart_after_save, as |
| 406 | // that would reload the just-saved game immediately. |
| 407 | if (ge.exit_reason == game_exit::save) |
| 408 | crawl_state.last_type = GAME_TYPE_UNSPECIFIED; |
| 409 | } |
| 410 | catch (const ext_fail_exception &fe) |
| 411 | { |
| 412 | end(1, false, "%s", fe.what()); |
| 413 | } |
| 414 | catch (const short_read_exception&) |
| 415 | { |
| 416 | end(1, false, "Error: truncation inside the save file.\n"); |
| 417 | } |
| 418 | } while (crawl_should_restart(crawl_state.last_game_exit.exit_reason) |
| 419 | && game_ended |
| 420 | && !crawl_state.seen_hups); |
| 421 | } |
| 422 | |
| 423 | NORETURN static void _launch_game() |
| 424 | { |
no test coverage detected