From 52dfd28b9f33ae3440dd7d8dc2bcce85e739bb5d Mon Sep 17 00:00:00 2001 From: deskull Date: Thu, 4 Jul 2019 20:22:50 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20get=5Fstats()=20=E3=81=AB?= =?utf8?q?=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD?= =?utf8?q?=E5=8A=A0=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/birth.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/birth.c b/src/birth.c index 306b5cd65..96f5f2902 100644 --- a/src/birth.c +++ b/src/birth.c @@ -1097,7 +1097,7 @@ static int adjust_stat(int value, int amount) * For efficiency, we include a chunk of "calc_bonuses()".\n * @return なし */ -static void get_stats(void) +static void get_stats(player_type *creature_ptr) { /* Roll and verify some stats */ while (TRUE) @@ -1119,7 +1119,7 @@ static void get_stats(void) /* Save that value */ sum += val; - p_ptr->stat_cur[3*i] = p_ptr->stat_max[3*i] = val; + creature_ptr->stat_cur[3*i] = creature_ptr->stat_max[3*i] = val; /* Extract 5 + 1d3 + 1d4 + 1d5 */ val = 5 + 3; @@ -1129,7 +1129,7 @@ static void get_stats(void) /* Save that value */ sum += val; - p_ptr->stat_cur[3*i+1] = p_ptr->stat_max[3*i+1] = val; + creature_ptr->stat_cur[3*i+1] = creature_ptr->stat_max[3*i+1] = val; /* Extract 5 + 1d3 + 1d4 + 1d5 */ val = 5 + 3; @@ -1139,7 +1139,7 @@ static void get_stats(void) /* Save that value */ sum += val; - p_ptr->stat_cur[3*i+2] = p_ptr->stat_max[3*i+2] = val; + creature_ptr->stat_cur[3*i+2] = creature_ptr->stat_max[3*i+2] = val; } /* Verify totals */ @@ -4193,7 +4193,7 @@ static bool player_birth_aux(void) else { /* Get a new character */ - get_stats(); + get_stats(p_ptr); /* Roll for age/height/weight */ get_ahw(); @@ -4255,7 +4255,7 @@ static bool player_birth_aux(void) bool accept = TRUE; /* Get a new character */ - get_stats(); + get_stats(p_ptr); /* Advance the round */ auto_round++; -- 2.11.0