• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionbd5b444fd61f4df8096eb65569e0fd961d829e90 (tree)
Time2019-06-23 14:36:14
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1869,7 +1869,7 @@ static void process_world_aux_timeout(void)
18691869 /* Timed stealth */
18701870 if (p_ptr->tim_stealth)
18711871 {
1872- (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
1872+ (void)set_tim_stealth(p_ptr, p_ptr->tim_stealth - 1, TRUE);
18731873 }
18741874
18751875 /* Timed levitation */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -313,7 +313,7 @@ void dispel_player(void)
313313 (void)set_tim_infra(p_ptr, 0, TRUE);
314314 (void)set_tim_esp(0, TRUE);
315315 (void)set_tim_regen(p_ptr, 0, TRUE);
316- (void)set_tim_stealth(0, TRUE);
316+ (void)set_tim_stealth(p_ptr, 0, TRUE);
317317 (void)set_tim_levitation(0, TRUE);
318318 (void)set_tim_sh_touki(0, TRUE);
319319 (void)set_tim_sh_fire(0, TRUE);
@@ -1633,19 +1633,19 @@ bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
16331633 * @param do_dec 現在の継続時間より長い値のみ上書きする
16341634 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
16351635 */
1636-bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
1636+bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
16371637 {
16381638 bool notice = FALSE;
16391639 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
16401640
1641- if (p_ptr->is_dead) return FALSE;
1641+ if (creature_ptr->is_dead) return FALSE;
16421642
16431643 /* Open */
16441644 if (v)
16451645 {
1646- if (p_ptr->tim_stealth && !do_dec)
1646+ if (creature_ptr->tim_stealth && !do_dec)
16471647 {
1648- if (p_ptr->tim_stealth > v) return FALSE;
1648+ if (creature_ptr->tim_stealth > v) return FALSE;
16491649 }
16501650 else if (!IS_TIM_STEALTH())
16511651 {
@@ -1657,7 +1657,7 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
16571657 /* Shut */
16581658 else
16591659 {
1660- if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
1660+ if (creature_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
16611661 {
16621662 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
16631663 notice = TRUE;
@@ -1665,14 +1665,14 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
16651665 }
16661666
16671667 /* Use the value */
1668- p_ptr->tim_stealth = v;
1669- p_ptr->redraw |= (PR_STATUS);
1668+ creature_ptr->tim_stealth = v;
1669+ creature_ptr->redraw |= (PR_STATUS);
16701670
16711671 /* Nothing to notice */
16721672 if (!notice) return (FALSE);
16731673
16741674 if (disturb_state) disturb(FALSE, FALSE);
1675- p_ptr->update |= (PU_BONUS);
1675+ creature_ptr->update |= (PU_BONUS);
16761676 handle_stuff();
16771677 return (TRUE);
16781678 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -34,7 +34,7 @@ extern bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3434 extern bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3535 extern bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3636 extern bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
37-extern bool set_tim_stealth(TIME_EFFECT v, bool do_dec);
37+extern bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3838 extern bool set_lightspeed(TIME_EFFECT v, bool do_dec);
3939 extern bool set_tim_levitation(TIME_EFFECT v, bool do_dec);
4040 extern bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec);
Show on old repository browser