From 3156c2e3bc0d513a4332c7f472fd6b9b31a5094e Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 19 Dec 2006 13:17:13 +0000 Subject: Handle SIGHUP. Could use improvement, but it's a start. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@673 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/files.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crawl-ref/source/files.cc') diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 82e4c75259..2c1ffb7486 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1161,6 +1161,8 @@ void save_level(int level_saved, bool was_a_labyrinth, char where_were_you) void save_game(bool leave_game) { + unwind_bool saving_game(crawl_state.saving_game, true); + /* Stashes */ std::string stashFile = get_savedir_filename( you.your_name, "", "st" ); FILE *stashf = fopen(stashFile.c_str(), "wb"); @@ -1250,6 +1252,14 @@ void save_game(bool leave_game) end(0); } // end save_game() +// Saves the game without exiting. +void save_game_state() +{ + save_game(false); + if (crawl_state.seen_hups) + save_game(true); +} + void load_ghost(void) { char majorVersion; -- cgit v1.2.3-54-g00ecf