• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiond3bb382cb95554f68ad994efd6fb8e461f235f8c (tree)
Time2019-07-08 00:22:54
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 do_cmd_histpref() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -3547,7 +3547,7 @@ void add_history_from_pref_line(concptr t)
35473547 * @brief 生い立ちメッセージをファイルからロードする。
35483548 * @return なし
35493549 */
3550-static bool do_cmd_histpref(void)
3550+static bool do_cmd_histpref(player_type *creature_ptr)
35513551 {
35523552 char buf[80];
35533553 errr err;
@@ -3563,9 +3563,9 @@ static bool do_cmd_histpref(void)
35633563 histpref_buf = histbuf;
35643564
35653565 #ifdef JP
3566- sprintf(buf, "histedit-%s.prf", p_ptr->base_name);
3566+ sprintf(buf, "histedit-%s.prf", creature_ptr->base_name);
35673567 #else
3568- sprintf(buf, "histpref-%s.prf", p_ptr->base_name);
3568+ sprintf(buf, "histpref-%s.prf", creature_ptr->base_name);
35693569 #endif
35703570 err = process_histpref_file(buf);
35713571
@@ -3602,7 +3602,7 @@ static bool do_cmd_histpref(void)
36023602 }
36033603
36043604 /* Clear the previous history strings */
3605- for (i = 0; i < 4; i++) p_ptr->history[i][0] = '\0';
3605+ for (i = 0; i < 4; i++) creature_ptr->history[i][0] = '\0';
36063606
36073607 /* Skip leading spaces */
36083608 for (s = histpref_buf; *s == ' '; s++) /* loop */;
@@ -3620,7 +3620,7 @@ static bool do_cmd_histpref(void)
36203620 if (t[0] == 0) break;
36213621 else
36223622 {
3623- strcpy(p_ptr->history[i], t);
3623+ strcpy(creature_ptr->history[i], t);
36243624 t += strlen(t) + 1;
36253625 }
36263626 }
@@ -3628,10 +3628,10 @@ static bool do_cmd_histpref(void)
36283628 /* Fill the remaining spaces */
36293629 for (i = 0; i < 4; i++)
36303630 {
3631- for (j = 0; p_ptr->history[i][j]; j++) /* loop */;
3631+ for (j = 0; creature_ptr->history[i][j]; j++) /* loop */;
36323632
3633- for (; j < 59; j++) p_ptr->history[i][j] = ' ';
3634- p_ptr->history[i][59] = '\0';
3633+ for (; j < 59; j++) creature_ptr->history[i][j] = ' ';
3634+ creature_ptr->history[i][59] = '\0';
36353635 }
36363636
36373637 /* Kill the buffer */
@@ -3772,7 +3772,7 @@ static void edit_history(player_type *creature_ptr)
37723772 }
37733773 else if (c == KTRL('A'))
37743774 {
3775- if (do_cmd_histpref())
3775+ if (do_cmd_histpref(creature_ptr))
37763776 {
37773777 #ifdef JP
37783778 if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--;
Show on old repository browser