OSDN Git Service

[Refactor] #39963 Changed return type from void to effect_monster_type* in initialize...
authorHourier <hourier@users.sourceforge.jp>
Thu, 30 Apr 2020 03:10:52 +0000 (12:10 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 30 Apr 2020 03:10:52 +0000 (12:10 +0900)
src/effect/effect-monster-util.c
src/effect/effect-monster-util.h
src/effect/effect-monster.c

index 6a18ddc..5ac1f42 100644 (file)
@@ -47,7 +47,7 @@ static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX w
  * @param see_s_msg TRUEならばメッセージを表示する
  * @return なし
  */
-void initialize_effect_monster(player_type *caster_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg)
+effect_monster_type *initialize_effect_monster(player_type *caster_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg)
 {
        substitute_effect_monster(em_ptr, who, r, y, x, dam, effect_type, flag, see_s_msg);
 
@@ -75,4 +75,5 @@ void initialize_effect_monster(player_type *caster_ptr, effect_monster_type *em_
        em_ptr->note = NULL;
        em_ptr->note_dies = extract_note_dies(real_r_idx(em_ptr->m_ptr));
        em_ptr->caster_lev = (em_ptr->who > 0) ? r_info[em_ptr->m_caster_ptr->r_idx].level : (caster_ptr->lev * 2);
+       return em_ptr;
 }
index 9610146..3c9c0f2 100644 (file)
@@ -39,4 +39,4 @@ typedef struct
        bool see_s_msg;
 } effect_monster_type;
 
-void initialize_effect_monster(player_type *caster_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg);
+effect_monster_type *initialize_effect_monster(player_type *caster_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg);
index 137a8dd..f3b4920 100644 (file)
@@ -528,7 +528,7 @@ static void postprocess_spell_photo(player_type *caster_ptr, effect_monster_type
 
 
 /*!
- * @brief モンスター効果の後処理 (ペット関係、グローバル変数更新)
+ * @brief モンスター効果の後処理 (ペット関係、記念撮影、グローバル変数更新)
  * @param caster_ptr プレーヤーへの参照ポインタ
  * @param em_ptr モンスター効果構造体への参照ポインタ
  * @return なし
@@ -560,8 +560,7 @@ static void postprocess_spell(player_type *caster_ptr, effect_monster_type *em_p
 bool affect_monster(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg)
 {
        effect_monster_type tmp_effect;
-       effect_monster_type *em_ptr = &tmp_effect;
-       initialize_effect_monster(caster_ptr, em_ptr, who, r, y, x, dam, effect_type, flag, see_s_msg);
+       effect_monster_type *em_ptr = initialize_effect_monster(caster_ptr, &tmp_effect, who, r, y, x, dam, effect_type, flag, see_s_msg);
        if (!is_never_effect(caster_ptr, em_ptr)) return FALSE;
 
        decide_spell_result_description(caster_ptr, em_ptr);