diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-19 13:17:13 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-19 13:17:13 +0000 |
commit | 3156c2e3bc0d513a4332c7f472fd6b9b31a5094e (patch) | |
tree | 122c5ac4494f743e2613176c9ed5d83daad1d480 /crawl-ref/source/files.cc | |
parent | bb1a887fb819272e46b5f593d2a2debf81a802ad (diff) | |
download | crawl-ref-3156c2e3bc0d513a4332c7f472fd6b9b31a5094e.tar.gz crawl-ref-3156c2e3bc0d513a4332c7f472fd6b9b31a5094e.zip |
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
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r-- | crawl-ref/source/files.cc | 10 |
1 files changed, 10 insertions, 0 deletions
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; |