summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc10
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;