From 0b0ae8380ba82f827e685387b885a16abc5af171 Mon Sep 17 00:00:00 2001 From: deskull Date: Wed, 3 Jul 2019 23:58:51 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20get=5Fhistory()=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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/birth.c b/src/birth.c index f88e62bb3..306b5cd65 100644 --- a/src/birth.c +++ b/src/birth.c @@ -1248,7 +1248,7 @@ static void get_extra(player_type *creature_ptr, bool roll_hitdie) * @brief プレイヤーの生い立ちの自動生成を行う。 / Get the racial history, and social class, using the "history charts". * @return なし */ -static void get_history(void) +static void get_history(player_type *creature_ptr) { int i, n, chart, roll, social_class; @@ -1257,7 +1257,7 @@ static void get_history(void) char buf[240]; /* 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'; /* Clear the history text */ buf[0] = '\0'; @@ -1266,7 +1266,7 @@ static void get_history(void) social_class = randint1(4); /* Starting place */ - switch (p_ptr->prace) + switch (creature_ptr->prace) { case RACE_AMBERITE: { @@ -1479,7 +1479,7 @@ static void get_history(void) else if (social_class < 1) social_class = 1; /* Save the social class */ - p_ptr->sc = (s16b)social_class; + creature_ptr->sc = (s16b)social_class; /* Skip leading spaces */ @@ -1498,7 +1498,7 @@ static void get_history(void) t = temp; for(i=0 ; i<4 ; i++){ if(t[0]==0)break; - else {strcpy(p_ptr->history[i], t);t += strlen(t)+1;} + else {strcpy(creature_ptr->history[i], t);t += strlen(t)+1;} } } } @@ -4199,7 +4199,7 @@ static bool player_birth_aux(void) get_ahw(); /* Roll for social class */ - get_history(); + get_history(p_ptr); } /* Feedback */ @@ -4300,7 +4300,7 @@ static bool player_birth_aux(void) get_ahw(); /* Roll for social class */ - get_history(); + get_history(p_ptr); if (autochara) { @@ -4342,7 +4342,7 @@ static bool player_birth_aux(void) get_ahw(); /* Roll for social class */ - get_history(); + get_history(p_ptr); break; } -- 2.11.0