• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionb168351d8327ccc2230623cbb9df4adb419f8816 (tree)
Time2019-06-20 23:23:31
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3399,14 +3399,14 @@ bool dec_stat(int stat, int amount, int permanent)
33993399 * @param stat 回復ステータスID
34003400 * @return 実際に回復した場合TRUEを返す。
34013401 */
3402-bool res_stat(int stat)
3402+bool res_stat(player_type *creature_ptr, int stat)
34033403 {
34043404 /* Restore if needed */
3405- if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
3405+ if (creature_ptr->stat_cur[stat] != creature_ptr->stat_max[stat])
34063406 {
3407- p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
3408- p_ptr->update |= (PU_BONUS);
3409- p_ptr->redraw |= (PR_STATS);
3407+ creature_ptr->stat_cur[stat] = creature_ptr->stat_max[stat];
3408+ creature_ptr->update |= (PU_BONUS);
3409+ creature_ptr->redraw |= (PR_STATS);
34103410
34113411 /* Success */
34123412 return (TRUE);
@@ -3558,7 +3558,7 @@ bool do_dec_stat(player_type *creature_ptr, int stat)
35583558 bool do_res_stat(int stat)
35593559 {
35603560 /* Attempt to increase */
3561- if (res_stat(stat))
3561+ if (res_stat(p_ptr, stat))
35623562 {
35633563 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
35643564
@@ -3578,7 +3578,7 @@ bool do_inc_stat(int stat)
35783578 bool res;
35793579
35803580 /* Restore strength */
3581- res = res_stat(stat);
3581+ res = res_stat(p_ptr, stat);
35823582
35833583 /* Attempt to increase */
35843584 if (inc_stat(stat))
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -59,7 +59,7 @@ extern bool set_cut(TIME_EFFECT v);
5959 extern bool set_food(TIME_EFFECT v);
6060 extern bool inc_stat(int stat);
6161 extern bool dec_stat(int stat, int amount, int permanent);
62-extern bool res_stat(int stat);
62+extern bool res_stat(player_type *creature_ptr, int stat);
6363 extern bool hp_player(int num);
6464 extern bool do_dec_stat(player_type *creature_ptr, int stat);
6565 extern bool do_res_stat(int stat);
Show on old repository browser