OSDN Git Service

通常のセーブ/ロード時以外でc_ptr->mimicに0以外の値を代入する際に, 最
[hengband/hengband.git] / src / spells3.c
index 37cedfa..87fd6f4 100644 (file)
@@ -148,7 +148,6 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power)
        int attempts = 500;
        int dis = 2;
        bool look = TRUE;
-       cave_type    *c_ptr;
        monster_type *m_ptr = &m_list[m_idx];
 
 
@@ -178,6 +177,8 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power)
                /* Try several locations */
                for (i = 0; i < 500; i++)
                {
+                       cave_type    *c_ptr;
+
                        /* Pick a (possibly illegal) location */
                        while (1)
                        {
@@ -226,7 +227,7 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power)
        sound(SOUND_TPOTHER);
 
        /* Update the new location */
-       c_ptr->m_idx = m_idx;
+       cave[ny][nx].m_idx = m_idx;
 
        /* Update the old location */
        cave[oy][ox].m_idx = 0;
@@ -520,7 +521,6 @@ msg_print("
 void teleport_level(int m_idx)
 {
        bool         go_up;
-       monster_type *m_ptr;
        char         m_name[160];
        bool         see_m = TRUE;
 
@@ -534,7 +534,7 @@ void teleport_level(int m_idx)
        }
        else /* To monster */
        {
-               m_ptr = &m_list[m_idx];
+               monster_type *m_ptr = &m_list[m_idx];
 
                /* Get the monster name (or "it") */
                monster_desc(m_name, m_ptr, 0);
@@ -683,6 +683,8 @@ void teleport_level(int m_idx)
        /* Monster level teleportation is simple deleting now */
        if (m_idx > 0)
        {
+               monster_type *m_ptr = &m_list[m_idx];
+
                /* Check for quest completion */
                check_quest_completion(m_ptr);
 
@@ -1520,6 +1522,8 @@ static bool vanish_dungeon(void)
                                /* Reset sleep counter */
                                m_ptr->csleep = 0;
 
+                               if (r_info[m_ptr->r_idx].flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+
                                /* Notice the "waking up" */
                                if (m_ptr->ml)
                                {
@@ -1557,7 +1561,7 @@ static bool vanish_dungeon(void)
                c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
 
                /* Set boundary mimic if needed */
-               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = floor_type[randint0(100)];
+               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = f_info[floor_type[randint0(100)]].mimic;
 
                c_ptr = &cave[cur_hgt - 1][x];
 
@@ -1565,7 +1569,7 @@ static bool vanish_dungeon(void)
                c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
 
                /* Set boundary mimic if needed */
-               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = floor_type[randint0(100)];
+               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = f_info[floor_type[randint0(100)]].mimic;
        }
 
        /* Special boundary walls -- Left and right */
@@ -1577,7 +1581,7 @@ static bool vanish_dungeon(void)
                c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
 
                /* Set boundary mimic if needed */
-               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = floor_type[randint0(100)];
+               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = f_info[floor_type[randint0(100)]].mimic;
 
                c_ptr = &cave[y][cur_wid - 1];
 
@@ -1585,7 +1589,7 @@ static bool vanish_dungeon(void)
                c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
 
                /* Set boundary mimic if needed */
-               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = floor_type[randint0(100)];
+               if (c_ptr->mimic && vanishable_feat(c_ptr->mimic)) c_ptr->mimic = f_info[floor_type[randint0(100)]].mimic;
        }
 
        /* Mega-Hack -- Forget the view and lite */
@@ -1889,7 +1893,7 @@ msg_print("
 
        /* Create a glyph */
        cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = FEAT_GLYPH;
+       cave[py][px].mimic = f_info[FEAT_GLYPH].mimic;
 
        /* Notice */
        note_spot(py, px);
@@ -1916,7 +1920,7 @@ msg_print("
 
        /* Create a mirror */
        cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = FEAT_MIRROR;
+       cave[py][px].mimic = f_info[FEAT_MIRROR].mimic;
 
        /* Turn on the light */
        cave[py][px].info |= CAVE_GLOW;
@@ -1950,7 +1954,7 @@ msg_print("
 
        /* Create a glyph */
        cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = FEAT_MINOR_GLYPH;
+       cave[py][px].mimic = f_info[FEAT_MINOR_GLYPH].mimic;
 
        /* Notice */
        note_spot(py, px);
@@ -6134,6 +6138,9 @@ msg_format("
                p_ptr->csp = p_ptr->msp;
        }
 
+       /* Redraw mana and hp */
+       p_ptr->redraw |= (PR_MANA);
+
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
        p_ptr->window |= (PW_INVEN);