1 #include "signal-handlers.h"
2 #include "io/write-diary.h"
3 #include "cmd/cmd-save.h"
4 #include "cmd/cmd-dump.h"
5 #include "player-move.h"
6 #include "core.h" // 暫定。後で消す.
9 #include "monster-status.h" // 違和感。要調査.
13 * @brief セーブするコマンドのメインルーチン
15 * @param creature_ptr プレーヤーへの参照ポインタ
16 * @param is_autosave オートセーブ中の処理ならばTRUE
20 void do_cmd_save_game(player_type *creature_ptr, int is_autosave)
24 msg_print(_("自動セーブ中", "Autosaving the game..."));
28 disturb(creature_ptr, TRUE, TRUE);
32 handle_stuff(creature_ptr);
33 prt(_("ゲームをセーブしています...", "Saving game..."), 0, 0);
35 (void)strcpy(creature_ptr->died_from, _("(セーブ)", "(saved)"));
36 signals_ignore_tstp();
37 if (save_player(creature_ptr))
39 prt(_("ゲームをセーブしています... 終了", "Saving game... done."), 0, 0);
43 prt(_("ゲームをセーブしています... 失敗!", "Saving game... failed!"), 0, 0);
46 signals_handle_tstp();
48 (void)strcpy(creature_ptr->died_from, _("(元気に生きている)", "(alive and well)"));
49 current_world_ptr->is_loading_now = FALSE;
50 update_creature(creature_ptr);
51 mproc_init(creature_ptr->current_floor_ptr);
52 current_world_ptr->is_loading_now = TRUE;
57 * @brief セーブ後にゲーム中断フラグを立てる/
58 * Save the game and exit
62 void do_cmd_save_and_exit(player_type *creature_ptr)
64 creature_ptr->playing = FALSE;
65 creature_ptr->leaving = TRUE;
66 exe_write_diary(creature_ptr, DIARY_GAMESTART, 0, _("----ゲーム中断----", "--- Saved and Exited Game ---"));