OSDN Git Service

モンスターのテレポートバックやテレポートで候補位置が同じだった場合に
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 15 Jan 2004 12:26:21 +0000 (12:26 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 15 Jan 2004 12:26:21 +0000 (12:26 +0000)
モンスターが消えてしまうバグを修正. また, グリッドのm_idxの移動操作は
"新しい位置にm_idxを入れて古い位置は0にする" ではなく "古い位置を0に
して新しい位置にm_idxを入れる" 順序に直した.

src/floors.c
src/spells2.c
src/spells3.c

index 33f5f2c..1514660 100644 (file)
@@ -707,12 +707,12 @@ static void get_out_monster(void)
 
                m_ptr = &m_list[m_idx];
 
-               /* Update the new location */
-               cave[ny][nx].m_idx = m_idx;
-
                /* Update the old location */
                cave[oy][ox].m_idx = 0;
 
+               /* Update the new location */
+               cave[ny][nx].m_idx = m_idx;
+
                /* Move the monster */
                m_ptr->fy = ny;
                m_ptr->fx = nx; 
index ee38ff3..884abbf 100644 (file)
@@ -5701,12 +5701,12 @@ msg_format("%^s
                                        {
                                                int m_idx = cave[yy][xx].m_idx;
 
-                                               /* Update the new location */
-                                               cave[sy][sx].m_idx = m_idx;
-
                                                /* Update the old location */
                                                cave[yy][xx].m_idx = 0;
 
+                                               /* Update the new location */
+                                               cave[sy][sx].m_idx = m_idx;
+
                                                /* Move the monster */
                                                m_ptr->fy = sy;
                                                m_ptr->fx = sx;
index 3d2dd85..142361d 100644 (file)
@@ -127,12 +127,12 @@ bool teleport_away(int m_idx, int dis, bool dec_valour, bool passive)
        /* Sound */
        sound(SOUND_TPOTHER);
 
-       /* Update the new location */
-       cave[ny][nx].m_idx = m_idx;
-
        /* Update the old location */
        cave[oy][ox].m_idx = 0;
 
+       /* Update the new location */
+       cave[ny][nx].m_idx = m_idx;
+
        /* Move the monster */
        m_ptr->fy = ny;
        m_ptr->fx = nx;
@@ -230,12 +230,12 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power, bool passive)
        /* Sound */
        sound(SOUND_TPOTHER);
 
-       /* Update the new location */
-       cave[ny][nx].m_idx = m_idx;
-
        /* Update the old location */
        cave[oy][ox].m_idx = 0;
 
+       /* Update the new location */
+       cave[ny][nx].m_idx = m_idx;
+
        /* Move the monster */
        m_ptr->fy = ny;
        m_ptr->fx = nx;