From 0ee1c3db5d60e63d46386f5c97eef5f4603fbeec Mon Sep 17 00:00:00 2001 From: deskull Date: Tue, 2 Jul 2019 23:49:57 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20get=5Fmax=5Fstats()=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 +++++++++--------- src/birth.h | 2 +- src/cmd-quaff.c | 2 +- src/player-effects.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/birth.c b/src/birth.c index a732d24e5..6bf175771 100644 --- a/src/birth.c +++ b/src/birth.c @@ -1152,7 +1152,7 @@ static void get_stats(void) * @brief プレイヤーの限界ステータスを決める。 * @return なし */ -void get_max_stats(void) +void get_max_stats(player_type *creature_ptr) { int i, j; int dice[6]; @@ -1180,14 +1180,14 @@ void get_max_stats(void) BASE_STATUS max_max = 18 + 60 + dice[i]*10; /* Save that value */ - p_ptr->stat_max_max[i] = max_max; - if (p_ptr->stat_max[i] > max_max) - p_ptr->stat_max[i] = max_max; - if (p_ptr->stat_cur[i] > max_max) - p_ptr->stat_cur[i] = max_max; + creature_ptr->stat_max_max[i] = max_max; + if (creature_ptr->stat_max[i] > max_max) + creature_ptr->stat_max[i] = max_max; + if (creature_ptr->stat_cur[i] > max_max) + creature_ptr->stat_cur[i] = max_max; } - p_ptr->knowledge &= ~(KNOW_STAT); - p_ptr->redraw |= (PR_STATS); + creature_ptr->knowledge &= ~(KNOW_STAT); + creature_ptr->redraw |= (PR_STATS); } @@ -4464,7 +4464,7 @@ static bool player_birth_aux(void) /*** Finish up ***/ - get_max_stats(); + get_max_stats(p_ptr); get_virtues(p_ptr); diff --git a/src/birth.h b/src/birth.h index f24a8eaef..02455dfe7 100644 --- a/src/birth.h +++ b/src/birth.h @@ -39,7 +39,7 @@ extern birther previous_char; /* birth.c */ extern void add_history_from_pref_line(concptr t); extern void player_birth(player_type *creature_ptr); -extern void get_max_stats(void); +extern void get_max_stats(player_type *creature_ptr); extern void get_height_weight(void); extern void player_outfit(void); extern void dump_yourself(FILE *fff); diff --git a/src/cmd-quaff.c b/src/cmd-quaff.c index 8ae3a104b..06f032450 100644 --- a/src/cmd-quaff.c +++ b/src/cmd-quaff.c @@ -468,7 +468,7 @@ void exe_quaff_potion(INVENTORY_IDX item) case SV_POTION_NEW_LIFE: roll_hitdice(p_ptr, 0L); - get_max_stats(); + get_max_stats(p_ptr); p_ptr->update |= PU_BONUS; lose_all_mutations(p_ptr); ident = TRUE; diff --git a/src/player-effects.c b/src/player-effects.c index 84f970a3c..b1d5a1ef7 100644 --- a/src/player-effects.c +++ b/src/player-effects.c @@ -3879,7 +3879,7 @@ void do_poly_self(player_type *creature_ptr) { power -= 10; - get_max_stats(); + get_max_stats(p_ptr); roll_hitdice(creature_ptr, 0L); } -- 2.11.0