• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision9fc6a431ad17e48c00bb3ae0fd641b2cdb732657 (tree)
Time2019-06-29 02:08:58
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- 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)
176176 s64b_mul(&new_exp, &new_exp_frac, 0, r_ptr->mexp);
177177
178178 /* Gain experience */
179- gain_exp_64(new_exp, new_exp_frac);
179+ gain_exp_64(p_ptr, new_exp, new_exp_frac);
180180 }
181181
182182
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3906,20 +3906,20 @@ void do_poly_self(player_type *creature_ptr)
39063906 /*
39073907 * Gain experience
39083908 */
3909-void gain_exp_64(s32b amount, u32b amount_frac)
3909+void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
39103910 {
3911- if (p_ptr->is_dead) return;
3911+ if (creature_ptr->is_dead) return;
39123912
3913- if (p_ptr->prace == RACE_ANDROID) return;
3913+ if (creature_ptr->prace == RACE_ANDROID) return;
39143914
39153915 /* Gain some experience */
3916- s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
3916+ s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac);
39173917
39183918 /* Slowly recover from experience drainage */
3919- if (p_ptr->exp < p_ptr->max_exp)
3919+ if (creature_ptr->exp < creature_ptr->max_exp)
39203920 {
39213921 /* Gain max experience (20%) (was 10%) */
3922- p_ptr->max_exp += amount / 5;
3922+ creature_ptr->max_exp += amount / 5;
39233923 }
39243924
39253925 /* Check Experience */
@@ -3932,7 +3932,7 @@ void gain_exp_64(s32b amount, u32b amount_frac)
39323932 */
39333933 void gain_exp(player_type *creature_ptr, s32b amount)
39343934 {
3935- gain_exp_64(amount, 0L);
3935+ gain_exp_64(creature_ptr, amount, 0L);
39363936 }
39373937
39383938
--- 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);
6666 extern bool do_inc_stat(player_type *creature_ptr, int stat);
6767 extern bool restore_level(player_type *creature_ptr);
6868 extern bool lose_all_info(player_type *creature_ptr);
69-extern void gain_exp_64(s32b amount, u32b amount_frac);
69+extern void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac);
7070 extern void gain_exp(player_type *creature_ptr, s32b amount);
7171 extern void calc_android_exp(player_type *creature_ptr);
7272 extern void lose_exp(player_type *creature_ptr, s32b amount);
Show on old repository browser