OSDN Git Service

モンスター対モンスターの魔法ターゲット選択時に自分自身を選んでしまう
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 26 Apr 2004 20:31:25 +0000 (20:31 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 26 Apr 2004 20:31:25 +0000 (20:31 +0000)
場合があるバグを修正. 特にモンスター格闘場で発生しやすかった.
projectable()の仕様変更によるエンバグだった.

src/mspells2.c

index a3e90ad..d355c4b 100644 (file)
@@ -324,7 +324,7 @@ bool monst_spell_monst(int m_idx)
                t_ptr = &m_list[t_idx];
 
                /* Cancel if not projectable (for now) */
-               if (!projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+               if ((m_idx == t_idx) || !projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
                {
                        t_idx = 0;
                }
@@ -340,8 +340,8 @@ bool monst_spell_monst(int m_idx)
                        t_ptr = &m_list[t_idx];
 
                        /* Cancel if neither enemy nor a given target */
-                       if (t_idx != pet_t_m_idx &&
-                           !are_enemies(m_ptr, t_ptr))
+                       if ((m_idx == t_idx) ||
+                           ((t_idx != pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
                        {
                                t_idx = 0;
                        }
@@ -381,7 +381,7 @@ bool monst_spell_monst(int m_idx)
                        if (!t_ptr->r_idx) continue;
 
                        /* Monster must be 'an enemy' */
-                       if (!are_enemies(m_ptr, t_ptr)) continue;
+                       if ((m_idx == t_idx) || !are_enemies(m_ptr, t_ptr)) continue;
 
                        /* Monster must be projectable */
                        if (!projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;