OSDN Git Service

[Refactor] #38997 'while (1)' を 'while (TRUE)' に変更 / Changed 'while (1)' to 'while...
[hengband/hengband.git] / src / files.c
index d14077c..11c9abc 100644 (file)
@@ -2717,7 +2717,7 @@ static void tim_player_flags(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_S
        for (i = 0; i < TR_FLAG_SIZE; i++)
                flgs[i] = 0L;
 
-       if (IS_HERO() || creature_ptr->shero)
+       if (IS_HERO(creature_ptr) || creature_ptr->shero)
                add_flag(flgs, TR_RES_FEAR);
        if (creature_ptr->tim_invis)
                add_flag(flgs, TR_SEE_INVIS);
@@ -2882,7 +2882,7 @@ void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
+static void known_obj_immunity(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
        for (i = 0; i < TR_FLAG_SIZE; i++)
@@ -2896,7 +2896,7 @@ static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
                object_type *o_ptr;
 
                /* Object */
-               o_ptr = &p_ptr->inventory_list[i];
+               o_ptr = &creature_ptr->inventory_list[i];
 
                if (!o_ptr->k_idx) continue;
 
@@ -2917,19 +2917,19 @@ static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
  * @todo
  * xtra1.c周りと多重実装になっているのを何とかする
  */
-static void player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
+static void player_immunity(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
 {
        int i;
        for (i = 0; i < TR_FLAG_SIZE; i++)
                flgs[i] = 0L;
 
-       if (PRACE_IS_(p_ptr, RACE_SPECTRE))
+       if (PRACE_IS_(creature_ptr, RACE_SPECTRE))
                add_flag(flgs, TR_RES_NETHER);
-       if (p_ptr->mimic_form == MIMIC_VAMPIRE || PRACE_IS_(p_ptr, RACE_VAMPIRE))
+       if (creature_ptr->mimic_form == MIMIC_VAMPIRE || PRACE_IS_(creature_ptr, RACE_VAMPIRE))
                add_flag(flgs, TR_RES_DARK);
-       if (p_ptr->mimic_form == MIMIC_DEMON_LORD)
+       if (creature_ptr->mimic_form == MIMIC_DEMON_LORD)
                add_flag(flgs, TR_RES_FIRE);
-       else if (PRACE_IS_(p_ptr, RACE_YEEK) && p_ptr->lev > 19)
+       else if (PRACE_IS_(creature_ptr, RACE_YEEK) && creature_ptr->lev > 19)
                add_flag(flgs, TR_RES_ACID);
 }
 
@@ -3149,7 +3149,7 @@ static void display_flag_aux(TERM_LEN row, TERM_LEN col, concptr header,
  * Special display, part 1
  * @return なし
  */
-static void display_player_flag_info(void)
+static void display_player_flag_info(player_type *creature_ptr)
 {
        TERM_LEN row;
        TERM_LEN col;
@@ -3157,12 +3157,12 @@ static void display_player_flag_info(void)
        all_player_flags f;
 
        /* Extract flags and store */
-       player_flags(p_ptr, f.player_flags);
-       tim_player_flags(p_ptr, f.tim_player_flags);
-       player_immunity(f.player_imm);
-       tim_player_immunity(p_ptr, f.tim_player_imm);
-       known_obj_immunity(f.known_obj_imm);
-       player_vuln_flags(p_ptr, f.player_vuln);
+       player_flags(creature_ptr, f.player_flags);
+       tim_player_flags(creature_ptr, f.tim_player_flags);
+       player_immunity(creature_ptr, f.player_imm);
+       tim_player_immunity(creature_ptr, f.tim_player_imm);
+       known_obj_immunity(creature_ptr, f.known_obj_imm);
+       player_vuln_flags(creature_ptr, f.player_vuln);
 
        /*** Set 1 ***/
 
@@ -3280,7 +3280,7 @@ static void display_player_flag_info(void)
  * Special display, part 2
  * @return なし
  */
-static void display_player_other_flag_info(void)
+static void display_player_other_flag_info(player_type *creature_ptr)
 {
        TERM_LEN row;
        TERM_LEN col;
@@ -3288,12 +3288,12 @@ static void display_player_other_flag_info(void)
        all_player_flags f;
 
        /* Extract flags and store */
-       player_flags(p_ptr, f.player_flags);
-       tim_player_flags(p_ptr, f.tim_player_flags);
-       player_immunity(f.player_imm);
-       tim_player_immunity(p_ptr, f.tim_player_imm);
-       known_obj_immunity(f.known_obj_imm);
-       player_vuln_flags(p_ptr, f.player_vuln);
+       player_flags(creature_ptr, f.player_flags);
+       tim_player_flags(creature_ptr, f.tim_player_flags);
+       player_immunity(creature_ptr, f.player_imm);
+       tim_player_immunity(creature_ptr, f.tim_player_imm);
+       known_obj_immunity(creature_ptr, f.known_obj_imm);
+       player_vuln_flags(creature_ptr, f.player_vuln);
 
        /*** Set 1 ***/
 
@@ -3473,7 +3473,7 @@ static void display_player_other_flag_info(void)
  * Special display, part 2a
  * @return なし
  */
-static void display_player_misc_info(void)
+static void display_player_misc_info(player_type *creature_ptr)
 {
        char    buf[80];
        char    tmp[80];
@@ -3498,11 +3498,11 @@ put_str("職業  :", 5, 1);
 #else
                strcat(tmp," ");
 #endif
-       strcat(tmp,p_ptr->name);
+       strcat(tmp,creature_ptr->name);
 
        c_put_str(TERM_L_BLUE, tmp, 1, 34);
        c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 9);
-       c_put_str(TERM_L_BLUE, (p_ptr->mimic_form ? mimic_info[p_ptr->mimic_form].title : rp_ptr->title), 4, 9);
+       c_put_str(TERM_L_BLUE, (creature_ptr->mimic_form ? mimic_info[creature_ptr->mimic_form].title : rp_ptr->title), 4, 9);
        c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 9);
 
        /* Display extras */
@@ -3517,11 +3517,11 @@ put_str("MP  :", 8, 1);
 #endif
 
 
-       (void)sprintf(buf, "%d", (int)p_ptr->lev);
+       (void)sprintf(buf, "%d", (int)creature_ptr->lev);
        c_put_str(TERM_L_BLUE, buf, 6, 9);
-       (void)sprintf(buf, "%d/%d", (int)p_ptr->chp, (int)p_ptr->mhp);
+       (void)sprintf(buf, "%d/%d", (int)creature_ptr->chp, (int)creature_ptr->mhp);
        c_put_str(TERM_L_BLUE, buf, 7, 9);
-       (void)sprintf(buf, "%d/%d", (int)p_ptr->csp, (int)p_ptr->msp);
+       (void)sprintf(buf, "%d/%d", (int)creature_ptr->csp, (int)creature_ptr->msp);
        c_put_str(TERM_L_BLUE, buf, 8, 9);
 }
 
@@ -3974,7 +3974,7 @@ void display_player(player_type *creature_ptr, int mode)
                                        /* Bewere that INIT_ASSIGN resets the cur_num. */
                                        init_flags = INIT_NAME_ONLY;
 
-                                       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+                                       process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
 
 #ifdef JP
                                        sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[creature_ptr->current_floor_ptr->inside_quest].name, creature_ptr->died_from);
@@ -4010,7 +4010,7 @@ void display_player(player_type *creature_ptr, int mode)
                                        /* Get the quest text */
                                        init_flags = INIT_NAME_ONLY;
 
-                                       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+                                       process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
 
                                        sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[creature_ptr->current_floor_ptr->inside_quest].name);
                                }
@@ -4057,15 +4057,15 @@ void display_player(player_type *creature_ptr, int mode)
                /* See "http://www.cs.berkeley.edu/~davidb/angband.html" */
 
                /* Dump the info */
-               display_player_misc_info();
+               display_player_misc_info(creature_ptr);
                display_player_stat_info(creature_ptr);
-               display_player_flag_info();
+               display_player_flag_info(creature_ptr);
        }
 
        /* Special */
        else if (mode == 3)
        {
-               display_player_other_flag_info();
+               display_player_other_flag_info(creature_ptr);
        }
 
        else if (mode == 4)
@@ -4079,14 +4079,14 @@ void display_player(player_type *creature_ptr, int mode)
  * @param fff ファイルポインタ
  * @return なし
  */
-static void dump_aux_display_player(FILE *fff)
+static void dump_aux_display_player(player_type *creature_ptr, FILE *fff)
 {
        TERM_LEN x, y;
        TERM_COLOR a;
        char c;
        char buf[1024];
 
-       display_player(p_ptr, 0);
+       display_player(creature_ptr, 0);
 
        /* Dump part of the screen */
        for (y = 1; y < 22; y++)
@@ -4112,7 +4112,7 @@ static void dump_aux_display_player(FILE *fff)
        }
 
        /* Display history */
-       display_player(p_ptr, 1);
+       display_player(creature_ptr, 1);
 
        /* Dump part of the screen */
        for (y = 10; y < 19; y++)
@@ -4140,7 +4140,7 @@ static void dump_aux_display_player(FILE *fff)
        fprintf(fff, "\n");
 
        /* Display flags (part 1) */
-       display_player(p_ptr, 2);
+       display_player(creature_ptr, 2);
 
        /* Dump part of the screen */
        for (y = 2; y < 22; y++)
@@ -4171,7 +4171,7 @@ static void dump_aux_display_player(FILE *fff)
        fprintf(fff, "\n");
 
        /* Display flags (part 2) */
-       display_player(p_ptr, 3);
+       display_player(creature_ptr, 3);
 
        /* Dump part of the screen */
        for (y = 1; y < 22; y++)
@@ -4466,10 +4466,11 @@ static void dump_aux_class_special(FILE *fff)
 
 /*!
  * @brief クエスト情報をファイルにダンプする
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param fff ファイルポインタ
  * @return なし
  */
-static void dump_aux_quest(FILE *fff)
+static void dump_aux_quest(player_type *creature_ptr, FILE *fff)
 {
        QUEST_IDX i;
        QUEST_IDX *quest_num;
@@ -4486,9 +4487,9 @@ static void dump_aux_quest(FILE *fff)
 
        /* Dump Quest Information */
        fputc('\n', fff);
-       do_cmd_knowledge_quests_completed(fff, quest_num);
+       do_cmd_knowledge_quests_completed(creature_ptr, fff, quest_num);
        fputc('\n', fff);
-       do_cmd_knowledge_quests_failed(fff, quest_num);
+       do_cmd_knowledge_quests_failed(creature_ptr, fff, quest_num);
        fputc('\n', fff);
 
        /* Free Memory */
@@ -4976,10 +4977,11 @@ static void dump_aux_home_museum(FILE *fff)
 /*!
  * @brief ダンプ出力のメインルーチン
  * Output the character dump to a file
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param fff ファイルポインタ
  * @return エラーコード
  */
-errr make_character_dump(FILE *fff)
+errr make_character_dump(player_type *creature_ptr, FILE *fff)
 {
 #ifdef JP
        fprintf(fff, "  [変愚蛮怒 %d.%d.%d キャラクタ情報]\n\n",
@@ -4991,11 +4993,11 @@ errr make_character_dump(FILE *fff)
 
        update_playtime();
 
-       dump_aux_display_player(fff);
+       dump_aux_display_player(p_ptr, fff);
        dump_aux_last_message(fff);
        dump_aux_options(fff);
        dump_aux_recall(fff);
-       dump_aux_quest(fff);
+       dump_aux_quest(creature_ptr, fff);
        dump_aux_arena(p_ptr, fff);
        dump_aux_monsters(fff);
        dump_aux_virtues(fff);
@@ -5015,13 +5017,14 @@ errr make_character_dump(FILE *fff)
 /*!
  * @brief プレイヤーステータスをファイルダンプ出力する
  * Hack -- Dump a character description file
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param name 出力ファイル名
  * @return エラーコード
  * @details
  * Allow the "full" flag to dump additional info,
  * and trigger its usage from various places in the code.
  */
-errr file_character(concptr name)
+errr file_character(player_type *creature_ptr, concptr name)
 {
        int             fd = -1;
        FILE            *fff = NULL;
@@ -5061,7 +5064,7 @@ errr file_character(concptr name)
                return (-1);
        }
 
-       (void)make_character_dump(fff);
+       (void)make_character_dump(creature_ptr, fff);
        my_fclose(fff);
 
 
@@ -5340,7 +5343,7 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG
                msg_format(_("'%s'をオープンできません。", "Cannot open '%s'."), name);
                msg_print(NULL);
 
-               return (TRUE);
+               return TRUE;
        }
 
 
@@ -5415,7 +5418,7 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG
                        /* Hack -- Re-Open the file */
                        fff = my_fopen(path, "r");
 
-                       if (!fff) return (FALSE);
+                       if (!fff) return FALSE;
 
                        /* File has been restarted */
                        next = 0;
@@ -5728,10 +5731,10 @@ bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAG
        my_fclose(fff);
 
        /* Escape */
-       if (skey == 'q') return (FALSE);
+       if (skey == 'q') return FALSE;
 
        /* Normal return */
-       return (TRUE);
+       return TRUE;
 }
 
 
@@ -5754,13 +5757,14 @@ void do_cmd_help(void)
 /*!
  * @brief プレイヤーの名前をチェックして修正する
  * Process the player name.
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param sf セーブファイル名に合わせた修正を行うならばTRUE
  * @return なし
  * @details
  * Extract a clean "base name".
  * Build the savefile name if needed.
  */
-void process_player_name(bool sf)
+void process_player_name(player_type *creature_ptr, bool sf)
 {
        int i, k = 0;
        char old_player_base[32] = "";
@@ -5868,7 +5872,7 @@ void process_player_name(bool sf)
        {
                concptr s;
                s = savefile;
-               while (1)
+               while (TRUE)
                {
                        concptr t;
                        t = my_strstr(s, PATH_SEP);
@@ -5902,7 +5906,7 @@ void process_player_name(bool sf)
        /* Load an autopick preference file */
        if (current_world_ptr->character_generated)
        {
-               if (!streq(old_player_base, p_ptr->base_name)) autopick_load_pref(FALSE);
+               if (!streq(old_player_base, p_ptr->base_name)) autopick_load_pref(creature_ptr, FALSE);
        }
 }
 
@@ -5919,24 +5923,24 @@ void process_player_name(bool sf)
  * What a horrible name for a global function.  
  * </pre>
  */
-void get_name(void)
+void get_name(player_type *creature_ptr)
 {
        char tmp[64];
 
        /* Save the player name */
-       strcpy(tmp, p_ptr->name);
+       strcpy(tmp, creature_ptr->name);
 
        /* Prompt for a new name */
        if (get_string(_("キャラクターの名前を入力して下さい: ", "Enter a name for your character: "), tmp, 15))
        {
                /* Use the name */
-               strcpy(p_ptr->name, tmp);
+               strcpy(creature_ptr->name, tmp);
        }
 
-       if (0 == strlen(p_ptr->name))
+       if (0 == strlen(creature_ptr->name))
        {
                /* Use default name */
-               strcpy(p_ptr->name, "PLAYER");
+               strcpy(creature_ptr->name, "PLAYER");
        }
 
        strcpy(tmp,ap_ptr->title);
@@ -5946,7 +5950,7 @@ void get_name(void)
 #else
        strcat(tmp, " ");
 #endif
-       strcat(tmp,p_ptr->name);
+       strcat(tmp,creature_ptr->name);
 
        /* Re-Draw the name (in light blue) */
        Term_erase(34, 1, 255);
@@ -5961,11 +5965,12 @@ void get_name(void)
 /*!
  * @brief セーブするコマンドのメインルーチン
  * Save the game
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param is_autosave オートセーブ中の処理ならばTRUE
  * @return なし
  * @details
  */
-void do_cmd_save_game(int is_autosave)
+void do_cmd_save_game(player_type *creature_ptr, int is_autosave)
 {
        /* Autosaves do not disturb */
        if (is_autosave)
@@ -5979,7 +5984,7 @@ void do_cmd_save_game(int is_autosave)
 
        /* Clear messages */
        msg_print(NULL);
-       handle_stuff();
+       handle_stuff(creature_ptr);
 
        prt(_("ゲームをセーブしています...", "Saving game..."), 0, 0);
 
@@ -5992,7 +5997,7 @@ void do_cmd_save_game(int is_autosave)
        signals_ignore_tstp();
 
        /* Save the player */
-       if (save_player())
+       if (save_player(creature_ptr))
        {
                prt(_("ゲームをセーブしています... 終了", "Saving game... done."), 0, 0);
        }
@@ -6140,7 +6145,7 @@ bool (*tombstone_aux)(void) = NULL;
  * Display a "tomb-stone"
  * @return なし
  */
-void print_tomb(void)
+void print_tomb(player_type *dead_ptr)
 {
        bool done = FALSE;
 
@@ -6187,7 +6192,7 @@ void print_tomb(void)
                }
 
                /* King or Queen */
-               if (current_world_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
+               if (current_world_ptr->total_winner || (dead_ptr->lev > PY_MAX_LEVEL))
                {
 #ifdef JP
                        /* 英日切り替え */
@@ -6200,10 +6205,10 @@ void print_tomb(void)
                /* Normal */
                else
                {
-                       p =  player_title[p_ptr->pclass][(p_ptr->lev - 1) / 5];
+                       p =  player_title[dead_ptr->pclass][(dead_ptr->lev - 1) / 5];
                }
 
-               center_string(buf, p_ptr->name);
+               center_string(buf, dead_ptr->name);
                put_str(buf, 6, 11);
 
 #ifndef JP
@@ -6217,35 +6222,35 @@ void print_tomb(void)
                center_string(buf, cp_ptr->title);
                put_str(buf, 10, 11);
 
-               (void)sprintf(tmp, _("レベル: %d", "Level: %d"), (int)p_ptr->lev);
+               (void)sprintf(tmp, _("レベル: %d", "Level: %d"), (int)dead_ptr->lev);
                center_string(buf, tmp);
                put_str(buf, 11, 11);
 
-               (void)sprintf(tmp, _("経験値: %ld", "Exp: %ld"), (long)p_ptr->exp);
+               (void)sprintf(tmp, _("経験値: %ld", "Exp: %ld"), (long)dead_ptr->exp);
                center_string(buf, tmp);
                put_str(buf, 12, 11);
 
-               (void)sprintf(tmp, _("所持金: %ld", "AU: %ld"), (long)p_ptr->au);
+               (void)sprintf(tmp, _("所持金: %ld", "AU: %ld"), (long)dead_ptr->au);
                center_string(buf, tmp);
                put_str(buf, 13, 11);
 
 #ifdef JP
                /* 墓に刻む言葉をオリジナルより細かく表示 */
-               if (streq(p_ptr->died_from, "途中終了"))
+               if (streq(dead_ptr->died_from, "途中終了"))
                {
                        strcpy(tmp, "<自殺>");
                }
-               else if (streq(p_ptr->died_from, "ripe"))
+               else if (streq(dead_ptr->died_from, "ripe"))
                {
                        strcpy(tmp, "引退後に天寿を全う");
                }
-               else if (streq(p_ptr->died_from, "Seppuku"))
+               else if (streq(dead_ptr->died_from, "Seppuku"))
                {
                        strcpy(tmp, "勝利の後、切腹");
                }
                else
                {
-                       roff_to_buf(p_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
+                       roff_to_buf(dead_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
                        t = tmp + strlen(tmp) + 1;
                        if (*t)
                        {
@@ -6285,12 +6290,12 @@ void print_tomb(void)
                center_string(buf, tmp);
                put_str(buf, 14, 11);
 
-               if (!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku"))
+               if (!streq(dead_ptr->died_from, "ripe") && !streq(dead_ptr->died_from, "Seppuku"))
                {
-                       if (p_ptr->current_floor_ptr->dun_level == 0)
+                       if (dead_ptr->current_floor_ptr->dun_level == 0)
                        {
-                               concptr field_name = p_ptr->town_num ? "街" : "荒野";
-                               if (streq(p_ptr->died_from, "途中終了"))
+                               concptr field_name = dead_ptr->town_num ? "街" : "荒野";
+                               if (streq(dead_ptr->died_from, "途中終了"))
                                {
                                        sprintf(tmp, "%sで死んだ", field_name);
                                }
@@ -6301,24 +6306,24 @@ void print_tomb(void)
                        }
                        else
                        {
-                               if (streq(p_ptr->died_from, "途中終了"))
+                               if (streq(dead_ptr->died_from, "途中終了"))
                                {
-                                       sprintf(tmp, "地下 %d 階で死んだ", (int)p_ptr->current_floor_ptr->dun_level);
+                                       sprintf(tmp, "地下 %d 階で死んだ", (int)dead_ptr->current_floor_ptr->dun_level);
                                }
                                else
                                {
-                                       sprintf(tmp, "に地下 %d 階で殺された", (int)p_ptr->current_floor_ptr->dun_level);
+                                       sprintf(tmp, "に地下 %d 階で殺された", (int)dead_ptr->current_floor_ptr->dun_level);
                                }
                        }
                        center_string(buf, tmp);
                        put_str(buf, 15 + extra_line, 11);
                }
 #else
-               (void)sprintf(tmp, "Killed on Level %d", p_ptr->current_floor_ptr->dun_level);
+               (void)sprintf(tmp, "Killed on Level %d", dead_ptr->current_floor_ptr->dun_level);
                center_string(buf, tmp);
                put_str(buf, 14, 11);
 
-               roff_to_buf(format("by %s.", p_ptr->died_from), GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
+               roff_to_buf(format("by %s.", dead_ptr->died_from), GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
                center_string(buf, tmp);
                put_str(buf, 15, 11);
                t = tmp + strlen(tmp) + 1;
@@ -6338,7 +6343,7 @@ void print_tomb(void)
                (void)sprintf(tmp, "%-.24s", ctime(&ct));
                center_string(buf, tmp);
                put_str(buf, 17, 11);
-               msg_format(_("さようなら、%s!", "Goodbye, %s!"), p_ptr->name);
+               msg_format(_("さようなら、%s!", "Goodbye, %s!"), dead_ptr->name);
        }
 }
 
@@ -6346,9 +6351,10 @@ void print_tomb(void)
 /*!
  * @brief 死亡、引退時の簡易ステータス表示 /
  * Display some character info
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
-void show_info(void)
+void show_info(player_type *creature_ptr)
 {
        int             i, j, k, l;
        object_type *o_ptr;
@@ -6357,11 +6363,11 @@ void show_info(void)
        /* Hack -- Know everything in the inven/equip */
        for (i = 0; i < INVEN_TOTAL; i++)
        {
-               o_ptr = &p_ptr->inventory_list[i];
+               o_ptr = &creature_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Aware and Known */
-               object_aware(o_ptr);
+               object_aware(creature_ptr, o_ptr);
                object_known(o_ptr);
        }
 
@@ -6376,14 +6382,14 @@ void show_info(void)
                        if (!o_ptr->k_idx) continue;
 
                        /* Aware and Known */
-                       object_aware(o_ptr);
+                       object_aware(creature_ptr, o_ptr);
                        object_known(o_ptr);
                }
        }
 
        /* Hack -- Recalculate bonuses */
-       p_ptr->update |= (PU_BONUS);
-       handle_stuff();
+       creature_ptr->update |= (PU_BONUS);
+       handle_stuff(creature_ptr);
 
        /* Flush all input keys */
        flush();
@@ -6414,12 +6420,12 @@ void show_info(void)
                screen_save();
 
                /* Dump a character file */
-               (void)file_character(out_val);
+               (void)file_character(creature_ptr, out_val);
                screen_load();
        }
 
        update_playtime();
-       display_player(p_ptr, 0);
+       display_player(creature_ptr, 0);
 
        prt(_("何かキーを押すとさらに情報が続きます (ESCで中断): ", "Hit any key to see more information (ESC to abort): "), 23, 0);
 
@@ -6427,20 +6433,20 @@ void show_info(void)
        if (inkey() == ESCAPE) return;
 
        /* Equipment -- if any */
-       if (p_ptr->equip_cnt)
+       if (creature_ptr->equip_cnt)
        {
                Term_clear();
-               (void)show_equip(0, USE_FULL, 0);
+               (void)show_equip(creature_ptr, 0, USE_FULL, 0);
                prt(_("装備していたアイテム: -続く-", "You are using: -more-"), 0, 0);
 
                if (inkey() == ESCAPE) return;
        }
 
        /* Inventory -- if any */
-       if (p_ptr->inven_cnt)
+       if (creature_ptr->inven_cnt)
        {
                Term_clear();
-               (void)show_inven(0, USE_FULL, 0);
+               (void)show_inven(creature_ptr, 0, USE_FULL, 0);
                prt(_("持っていたアイテム: -続く-", "You are carrying: -more-"), 0, 0);
 
                if (inkey() == ESCAPE) return;
@@ -6490,6 +6496,7 @@ void show_info(void)
 /*!
  * @brief 異常発生時のゲーム緊急終了処理 /
  * Handle abrupt death of the visual system
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  * @details
  * <pre>
@@ -6499,7 +6506,7 @@ void show_info(void)
  * save file so that player can see tombstone when restart.
  * </pre>
  */
-void exit_game_panic(void)
+void exit_game_panic(player_type *creature_ptr)
 {
        /* If nothing important has happened, just quit */
        if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(_("緊急事態", "panic"));
@@ -6526,7 +6533,7 @@ void exit_game_panic(void)
        (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
 
        /* Panic save, or get worried */
-       if (!save_player()) quit(_("緊急セーブ失敗!", "panic save failed!"));
+       if (!save_player(creature_ptr)) quit(_("緊急セーブ失敗!", "panic save failed!"));
 
        /* Successful panic save */
        quit(_("緊急セーブ成功!", "panic save succeeded!"));
@@ -6731,7 +6738,7 @@ static errr counts_seek(int fd, u32b where, bool flag)
                temp1[i] ^= (i+1) * 63;
 
        seekpoint = 0;
-       while (1)
+       while (TRUE)
        {
                if (fd_seek(fd, seekpoint + 3 * sizeof(u32b)))
                        return 1;
@@ -6932,7 +6939,7 @@ static void handle_signal_simple(int sig)
                clear_mon_lite(p_ptr->current_floor_ptr);
 
                /* Close stuff */
-               close_game();
+               close_game(p_ptr);
 
                /* Quit */
                quit(_("強制終了", "interrupt"));
@@ -6956,7 +6963,7 @@ static void handle_signal_simple(int sig)
                p_ptr->leaving = TRUE;
 
                /* Close stuff */
-               close_game();
+               close_game(p_ptr);
 
                /* Quit */
                quit(_("強制終了", "interrupt"));
@@ -7049,7 +7056,7 @@ static void handle_signal_abort(int sig)
        signals_ignore_tstp();
 
        /* Attempt to save */
-       if (save_player())
+       if (save_player(p_ptr))
        {
                Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ成功!", "Panic save succeeded!"));
        }