From d3bb382cb95554f68ad994efd6fb8e461f235f8c Mon Sep 17 00:00:00 2001 From: deskull Date: Mon, 8 Jul 2019 00:22:54 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20do=5Fcmd=5Fhistpref()=20?= =?utf8?q?=E3=81=AB=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/birth.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/birth.c b/src/birth.c index 91905bd29..fe70a03c5 100644 --- a/src/birth.c +++ b/src/birth.c @@ -3547,7 +3547,7 @@ void add_history_from_pref_line(concptr t) * @brief 生い立ちメッセージをファイルからロードする。 * @return なし */ -static bool do_cmd_histpref(void) +static bool do_cmd_histpref(player_type *creature_ptr) { char buf[80]; errr err; @@ -3563,9 +3563,9 @@ static bool do_cmd_histpref(void) histpref_buf = histbuf; #ifdef JP - sprintf(buf, "histedit-%s.prf", p_ptr->base_name); + sprintf(buf, "histedit-%s.prf", creature_ptr->base_name); #else - sprintf(buf, "histpref-%s.prf", p_ptr->base_name); + sprintf(buf, "histpref-%s.prf", creature_ptr->base_name); #endif err = process_histpref_file(buf); @@ -3602,7 +3602,7 @@ static bool do_cmd_histpref(void) } /* Clear the previous history strings */ - for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0'; + for (i = 0; i < 4; i++) creature_ptr->history[i][0] = '\0'; /* Skip leading spaces */ for (s = histpref_buf; *s == ' '; s++) /* loop */; @@ -3620,7 +3620,7 @@ static bool do_cmd_histpref(void) if (t[0] == 0) break; else { - strcpy(p_ptr->history[i], t); + strcpy(creature_ptr->history[i], t); t += strlen(t) + 1; } } @@ -3628,10 +3628,10 @@ static bool do_cmd_histpref(void) /* Fill the remaining spaces */ for (i = 0; i < 4; i++) { - for (j = 0; p_ptr->history[i][j]; j++) /* loop */; + for (j = 0; creature_ptr->history[i][j]; j++) /* loop */; - for (; j < 59; j++) p_ptr->history[i][j] = ' '; - p_ptr->history[i][59] = '\0'; + for (; j < 59; j++) creature_ptr->history[i][j] = ' '; + creature_ptr->history[i][59] = '\0'; } /* Kill the buffer */ @@ -3772,7 +3772,7 @@ static void edit_history(player_type *creature_ptr) } else if (c == KTRL('A')) { - if (do_cmd_histpref()) + if (do_cmd_histpref(creature_ptr)) { #ifdef JP if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--; -- 2.11.0