From fc907a583d958c3eb87bbe82cd34ca986d781627 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sun, 4 Mar 2012 21:04:18 +0100 Subject: Refactor: Remove duplicate code for autosaving. --- src/files.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/files.c') diff --git a/src/files.c b/src/files.c index d1b3d4f9..ea331a15 100644 --- a/src/files.c +++ b/src/files.c @@ -4239,7 +4239,19 @@ void do_cmd_save_game(void) (void)strcpy(died_from, "(alive and well)"); } - +/* + * Auto-save depending on whether the auto save flag is set. + */ +void autosave_checkpoint() +{ + if (autosave_l) + { + is_autosave = TRUE; + msg_print("Autosaving the game..."); + do_cmd_save_game(); + is_autosave = FALSE; + } +} /* * Hack -- Calculates the total number of points earned -JWT- -- cgit v1.2.3