MCPcopy Create free account
hub / github.com/crawl/crawl / _launch_game_loop

Function _launch_game_loop

crawl-ref/source/main.cc:389–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389static 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
423NORETURN static void _launch_game()
424{

Callers 1

mainFunction · 0.85

Calls 5

_launch_gameFunction · 0.85
_reset_gameFunction · 0.85
endFunction · 0.85
crawl_should_restartFunction · 0.85
whatMethod · 0.80

Tested by

no test coverage detected