OSDN Git Service

[Refactor] #38997 set_tim_sh_fire() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Sun, 23 Jun 2019 05:55:15 +0000 (14:55 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 23 Jun 2019 05:55:15 +0000 (14:55 +0900)
src/core.c
src/player-effects.c
src/player-effects.h
src/realm-daemon.c

index 55f42bb..61d7ab4 100644 (file)
@@ -1887,7 +1887,7 @@ static void process_world_aux_timeout(void)
        /* Timed sh_fire */
        if (p_ptr->tim_sh_fire)
        {
-               (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
+               (void)set_tim_sh_fire(p_ptr, p_ptr->tim_sh_fire - 1, TRUE);
        }
 
        /* Timed sh_holy */
index dfd0f51..58bf0fb 100644 (file)
@@ -316,7 +316,7 @@ void dispel_player(void)
        (void)set_tim_stealth(p_ptr, 0, TRUE);
        (void)set_tim_levitation(p_ptr, 0, TRUE);
        (void)set_tim_sh_touki(p_ptr, 0, TRUE);
-       (void)set_tim_sh_fire(0, TRUE);
+       (void)set_tim_sh_fire(p_ptr, 0, TRUE);
        (void)set_tim_sh_holy(0, TRUE);
        (void)set_tim_eyeeye(0, TRUE);
        (void)set_magicdef(p_ptr, 0, TRUE);
@@ -1837,21 +1837,21 @@ bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
+bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (p_ptr->is_dead) return FALSE;
+       if (creature_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
        {
-               if (p_ptr->tim_sh_fire && !do_dec)
+               if (creature_ptr->tim_sh_fire && !do_dec)
                {
-                       if (p_ptr->tim_sh_fire > v) return FALSE;
+                       if (creature_ptr->tim_sh_fire > v) return FALSE;
                }
-               else if (!p_ptr->tim_sh_fire)
+               else if (!creature_ptr->tim_sh_fire)
                {
                        msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
                        notice = TRUE;
@@ -1861,7 +1861,7 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->tim_sh_fire)
+               if (creature_ptr->tim_sh_fire)
                {
                        msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
                        notice = TRUE;
@@ -1869,14 +1869,14 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->tim_sh_fire = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->tim_sh_fire = v;
+       creature_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-       p_ptr->update |= (PU_BONUS);
+       creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
index abff5ea..d421584 100644 (file)
@@ -38,7 +38,7 @@ extern bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_de
 extern bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-extern bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec);
 extern bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec);
 extern bool set_resist_magic(TIME_EFFECT v, bool do_dec);
index fa158a8..7a8c109 100644 (file)
@@ -345,7 +345,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                                set_oppose_fire(dur, FALSE);
                                set_oppose_cold(dur, FALSE);
-                               set_tim_sh_fire(dur, FALSE);
+                               set_tim_sh_fire(p_ptr, dur, FALSE);
                                set_afraid(p_ptr, 0);
                                break;
                        }