OSDN Git Service

チェンジモンスターのときにplace_monster_one()で使っている外部変数
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 8 Jun 2002 23:51:14 +0000 (23:51 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 8 Jun 2002 23:51:14 +0000 (23:51 +0000)
 monster_terrain_sensitive の役割を modeフラグに移した。

src/defines.h
src/externs.h
src/monster2.c
src/spells3.c
src/variable.c

index 23ff4f5..8bd55ab 100644 (file)
 #define PM_NO_KAGE        0x00000010
 #define PM_NO_PET         0x00000020
 #define PM_ALLOW_UNIQUE   0x00000040
+#define PM_IGNORE_TERRAIN 0x00000080
 
 
 /*
index af97b3c..f08a98a 100644 (file)
@@ -479,7 +479,6 @@ extern int quest_text_line;
 extern s16b gf_color[MAX_GF];
 extern int init_flags;
 extern int highscore_fd;
-extern bool monster_terrain_sensitive;
 extern int mutant_regenerate_mod;
 extern bool easy_band;
 extern bool vanilla_town;
index a7b130a..41ef82f 100644 (file)
@@ -2733,7 +2733,7 @@ bool place_monster_one(int who, int y, int x, int r_idx, u32b mode)
         && (cave[y][x].feat <= FEAT_PATTERN_XTRA2))
                return (FALSE);
 
-       if (monster_terrain_sensitive &&
+       if (!(mode & PM_IGNORE_TERRAIN) &&
            !monster_can_cross_terrain(cave[y][x].feat, r_ptr))
        {
                return FALSE;
index ebf3310..a23d666 100644 (file)
@@ -5538,13 +5538,9 @@ bool polymorph_monster(int y, int x)
                }
                else
                {
-                       monster_terrain_sensitive = FALSE;
-
                        /* Placing the new monster failed */
-                       place_monster_aux(0, y, x, old_r_idx, (mode | PM_NO_KAGE));
+                       place_monster_aux(0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN));
                        m_list[hack_m_idx_ii] = back_m;
-
-                       monster_terrain_sensitive = TRUE;
                }
 
                if (targeted) target_who = hack_m_idx_ii;
index fb54f0f..584f951 100644 (file)
@@ -1125,11 +1125,6 @@ int init_flags;
  */
 int highscore_fd = -1;
 
-/*
- * Should the monster allocation fail with inappropriate terrain?
- */
-bool monster_terrain_sensitive = TRUE;
-
 int mutant_regenerate_mod = 100;
 
 /*