diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-03-04 21:04:18 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-03-29 20:41:39 +0200 |
commit | fc907a583d958c3eb87bbe82cd34ca986d781627 (patch) | |
tree | d7900cab6abe9249746e089c07d95957c0ea0a8c /src/spells1.c | |
parent | 1cef2bec6cfe51855e53ec29fa5ea64d506eb086 (diff) |
Refactor: Remove duplicate code for autosaving.
Diffstat (limited to 'src/spells1.c')
-rw-r--r-- | src/spells1.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/src/spells1.c b/src/spells1.c index fa2a846f..53686c5a 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -858,13 +858,7 @@ void teleport_player_level(void) { msg_print("You sink through the floor."); - if (autosave_l) - { - is_autosave = TRUE; - msg_print("Autosaving the game..."); - do_cmd_save_game(); - is_autosave = FALSE; - } + autosave_checkpoint(); dun_level++; @@ -875,13 +869,7 @@ void teleport_player_level(void) { msg_print("You rise up through the ceiling."); - if (autosave_l) - { - is_autosave = TRUE; - msg_print("Autosaving the game..."); - do_cmd_save_game(); - is_autosave = FALSE; - } + autosave_checkpoint(); dun_level--; @@ -892,13 +880,7 @@ void teleport_player_level(void) { msg_print("You rise up through the ceiling."); - if (autosave_l) - { - is_autosave = TRUE; - msg_print("Autosaving the game..."); - do_cmd_save_game(); - is_autosave = FALSE; - } + autosave_checkpoint(); dun_level--; @@ -909,13 +891,7 @@ void teleport_player_level(void) { msg_print("You sink through the floor."); - if (autosave_l) - { - is_autosave = TRUE; - msg_print("Autosaving the game..."); - do_cmd_save_game(); - is_autosave = FALSE; - } + autosave_checkpoint(); dun_level++; |