From: deskull Date: Fri, 28 Jun 2019 17:08:58 +0000 (+0900) Subject: [Refactor] #38997 gain_exp_64() に player_type * 引数を追加. X-Git-Tag: vmacos3.0.0-alpha52~3011 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9fc6a431ad17e48c00bb3ae0fd641b2cdb732657;p=hengbandforosx%2Fhengbandosx.git [Refactor] #38997 gain_exp_64() に player_type * 引数を追加. --- diff --git a/src/monster-status.c b/src/monster-status.c index 2a5c76f4a..8a5a8788c 100644 --- a/src/monster-status.c +++ b/src/monster-status.c @@ -176,7 +176,7 @@ static void get_exp_from_mon(HIT_POINT dam, monster_type *m_ptr) s64b_mul(&new_exp, &new_exp_frac, 0, r_ptr->mexp); /* Gain experience */ - gain_exp_64(new_exp, new_exp_frac); + gain_exp_64(p_ptr, new_exp, new_exp_frac); } diff --git a/src/player-effects.c b/src/player-effects.c index 79e42c58e..c75e0135c 100644 --- a/src/player-effects.c +++ b/src/player-effects.c @@ -3906,20 +3906,20 @@ void do_poly_self(player_type *creature_ptr) /* * Gain experience */ -void gain_exp_64(s32b amount, u32b amount_frac) +void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac) { - if (p_ptr->is_dead) return; + if (creature_ptr->is_dead) return; - if (p_ptr->prace == RACE_ANDROID) return; + if (creature_ptr->prace == RACE_ANDROID) return; /* Gain some experience */ - s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac); + s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac); /* Slowly recover from experience drainage */ - if (p_ptr->exp < p_ptr->max_exp) + if (creature_ptr->exp < creature_ptr->max_exp) { /* Gain max experience (20%) (was 10%) */ - p_ptr->max_exp += amount / 5; + creature_ptr->max_exp += amount / 5; } /* Check Experience */ @@ -3932,7 +3932,7 @@ void gain_exp_64(s32b amount, u32b amount_frac) */ void gain_exp(player_type *creature_ptr, s32b amount) { - gain_exp_64(amount, 0L); + gain_exp_64(creature_ptr, amount, 0L); } diff --git a/src/player-effects.h b/src/player-effects.h index a58cb331d..d4a3b9595 100644 --- a/src/player-effects.h +++ b/src/player-effects.h @@ -66,7 +66,7 @@ extern bool do_res_stat(player_type *creature_ptr, int stat); extern bool do_inc_stat(player_type *creature_ptr, int stat); extern bool restore_level(player_type *creature_ptr); extern bool lose_all_info(player_type *creature_ptr); -extern void gain_exp_64(s32b amount, u32b amount_frac); +extern void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac); extern void gain_exp(player_type *creature_ptr, s32b amount); extern void calc_android_exp(player_type *creature_ptr); extern void lose_exp(player_type *creature_ptr, s32b amount);