OSDN Git Service

CAVE_FLOORやCAVE_MASKの無駄な操作を削除。ダンジョン生成中だけ使用するフラグ
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 4 May 2002 15:03:33 +0000 (15:03 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 4 May 2002 15:03:33 +0000 (15:03 +0000)
は生成が終ったら全てクリアするようにした。今後は、CAVE_MASKに含まれるフラグは
ダンジョン生成の後なら別のフラグとして利用できる。

src/cmd1.c
src/cmd2.c
src/defines.h
src/generate.c
src/hissatsu.c
src/melee2.c
src/monster2.c
src/spells1.c
src/spells2.c

index f9c95cb..1a69544 100644 (file)
@@ -4109,8 +4109,6 @@ msg_format("%s
                                else
                                {
                                        cave[py][px].feat = floor_type[randint0(100)];
-                                       cave[py][px].info &= ~(CAVE_MASK);
-                                       cave[py][px].info |= CAVE_FLOOR;
                                }
                        }
                                /* Update some things -- similar to GF_KILL_WALL */
index e35be6f..8126c36 100644 (file)
@@ -1502,8 +1502,6 @@ static bool twall(int y, int x, byte feat)
 
        /* Forget the wall */
        c_ptr->info &= ~(CAVE_MARK);
-       c_ptr->info &= ~(CAVE_MASK);
-       c_ptr->info |= (CAVE_FLOOR);
 
        /* Remove the feature */
        cave_set_feat(y, x, feat);
@@ -2251,8 +2249,6 @@ static bool do_cmd_disarm_aux(int y, int x, int dir)
 
                /* Remove the trap */
                c_ptr->feat = floor_type[randint0(100)];
-               c_ptr->info &= ~(CAVE_MASK);
-               c_ptr->info |= CAVE_FLOOR;
                note_spot(y, x);
                lite_spot(y, x);
 
index 5f4d800..baa167b 100644 (file)
 #define CAVE_VAULT      0x4000
 #define CAVE_TRAP       0x8000
 
-#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID)
+#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
 
 /*
  * Bit flags for the "project()" function
index 22f6c0d..1458ee7 100644 (file)
@@ -1559,6 +1559,24 @@ static void place_pet(void)
 }
 
 /*
+ * Wipe all unnecessary flags after cave generation
+ */
+void wipe_generate_cave_flags(void)
+{
+       int x, y;
+
+       for (y = 0; y < MAX_HGT; y++)
+       {
+               for (x = 0; x < MAX_WID; x++)
+               {
+                       /* Wipe unused flags */
+                       cave[y][x].info &= ~(CAVE_MASK);
+               }
+       }
+
+}
+
+/*
  * Generates a random dungeon level                    -RAK-
  *
  * Hack -- regenerate any "overflow" levels
@@ -1799,6 +1817,8 @@ if (why) msg_format("
                }
        }
 
+       wipe_generate_cave_flags();
+
        place_pet();
 
        /* The dungeon is ready */
index 023b616..672023f 100644 (file)
@@ -675,8 +675,6 @@ static bool cast_hissatsu_spell(int spell)
 
                /* Destroy the feature */
                cave[y][x].feat = floor_type[randint0(100)];
-               cave[y][x].info &= ~(CAVE_MASK);
-               cave[y][x].info |= CAVE_FLOOR;
 
                /* Update some things */
                p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
index bb0f39a..a5d8d3b 100644 (file)
@@ -3169,8 +3169,6 @@ msg_print("
 
                        /* Notice */
                        c_ptr->feat = floor_type[randint0(100)];
-                       c_ptr->info &= ~(CAVE_MASK);
-                       c_ptr->info |= CAVE_FLOOR;
 
                        /* Note changes to viewable region */
                        if (player_has_los_bold(ny, nx)) do_view = TRUE;
@@ -3302,8 +3300,6 @@ msg_print("
 
                                /* Break the rune */
                                c_ptr->feat = floor_type[randint0(100)];
-                               c_ptr->info &= ~(CAVE_MASK);
-                               c_ptr->info |= CAVE_FLOOR;
 
                                /* Allow movement */
                                do_move = TRUE;
@@ -3350,8 +3346,6 @@ msg_print("
 
                                /* Break the rune */
                                c_ptr->feat = floor_type[randint0(100)];
-                               c_ptr->info &= ~(CAVE_MASK);
-                               c_ptr->info |= CAVE_FLOOR;
                                note_spot(ny, nx);
                                lite_spot(ny, nx);
 
@@ -3487,8 +3481,6 @@ msg_print("
                                if (r_ptr->flags2 & RF2_KILL_WALL)
                                {
                                        c_ptr->feat = FEAT_GRASS;
-                                       c_ptr->info &= ~(CAVE_MASK);
-                                       c_ptr->info |= CAVE_FLOOR;
                                }
                                if (!(r_ptr->flags7 & RF7_CAN_FLY) && !(r_ptr->flags8 & RF8_WILD_WOOD))
                                {
index 1e749d7..976041f 100644 (file)
@@ -2775,8 +2775,6 @@ msg_print("
 
                        /* Break the rune */
                        c_ptr->feat = floor_type[randint0(100)];
-                       c_ptr->info &= ~(CAVE_MASK);
-                       c_ptr->info |= CAVE_FLOOR;
 
                        /* Notice */
                        note_spot(y, x);
@@ -3100,8 +3098,6 @@ msg_print("
 
                /* Break the rune */
                c_ptr->feat = floor_type[randint0(100)];
-               c_ptr->info &= ~(CAVE_MASK);
-               c_ptr->info |= CAVE_FLOOR;
                note_spot(y, x);
                lite_spot(y, x);
        }
index 213eef6..4dcb9aa 100644 (file)
@@ -666,8 +666,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                        msg_format("A tree %s", message);
 #endif
                        c_ptr->feat = (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS);
-                       c_ptr->info &= ~(CAVE_MASK);
-                       c_ptr->info |= CAVE_FLOOR;
 
                        /* Observe */
                        if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
@@ -755,8 +753,6 @@ msg_print("
                                else
                                {
                                        c_ptr->feat = floor_type[randint0(100)];
-                                       c_ptr->info &= ~(CAVE_MASK);
-                                       c_ptr->info |= CAVE_FLOOR;
                                }
                        }
 
@@ -826,8 +822,6 @@ msg_print("
                                else
                                {
                                        c_ptr->feat = floor_type[randint0(100)];
-                                       c_ptr->info &= ~(CAVE_MASK);
-                                       c_ptr->info |= CAVE_FLOOR;
                                }
                        }
 
@@ -893,8 +887,6 @@ msg_print("
 
                                /* Destroy the wall */
                                c_ptr->feat = floor_type[randint0(100)];
-                               c_ptr->info &= ~(CAVE_MASK);
-                               c_ptr->info |= CAVE_FLOOR;
                        }
 
                        /* Quartz / Magma with treasure */
@@ -919,8 +911,6 @@ msg_print("
 
                                /* Destroy the wall */
                                c_ptr->feat = floor_type[randint0(100)];
-                               c_ptr->info &= ~(CAVE_MASK);
-                               c_ptr->info |= CAVE_FLOOR;
 
                                /* Place some gold */
                                place_gold(y, x);
@@ -946,8 +936,6 @@ msg_print("
 
                                /* Destroy the wall */
                                c_ptr->feat = floor_type[randint0(100)];
-                               c_ptr->info &= ~(CAVE_MASK);
-                               c_ptr->info |= CAVE_FLOOR;
                        }
 
                        /* Rubble */
@@ -970,8 +958,6 @@ msg_print("
 
                                /* Destroy the rubble */
                                c_ptr->feat = floor_type[randint0(100)];
-                               c_ptr->info &= ~(CAVE_MASK);
-                               c_ptr->info |= CAVE_FLOOR;
 
                                /* Hack -- place an object */
                                if (randint0(100) < 10)
@@ -1013,8 +999,6 @@ msg_print("
 
                                /* Destroy the feature */
                                c_ptr->feat = floor_type[randint0(100)];
-                               c_ptr->info &= ~(CAVE_MASK);
-                               c_ptr->info |= CAVE_FLOOR;
                        }
 
                        /* Notice */
@@ -7681,8 +7665,6 @@ void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte
                                                        else
                                                        {
                                                                cave[y][x].feat = floor_type[randint0(100)];
-                                                               cave[y][x].info &= ~(CAVE_MASK);
-                                                               cave[y][x].info |= CAVE_FLOOR;
                                                        }
                                                }
                                                /* Update some things -- similar to GF_KILL_WALL */
@@ -8462,8 +8444,6 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                                                                else
                                                                {
                                                                        cave[y][x].feat = floor_type[randint0(100)];
-                                                                       cave[y][x].info &= ~(CAVE_MASK);
-                                                                       cave[y][x].info |= CAVE_FLOOR;
                                                                }
                                                        }
 
index 7be92e6..c642bed 100644 (file)
@@ -5222,8 +5222,6 @@ bool destroy_area(int y1, int x1, int r, int full)
                                {
                                        /* Create floor */
                                        c_ptr->feat = floor_type[randint0(100)];
-                                       c_ptr->info &= ~(CAVE_MASK);
-                                       c_ptr->info |= CAVE_FLOOR;
                                }
                        }
                }
@@ -5729,8 +5727,6 @@ msg_format("%^s
                                {
                                        /* Create floor */
                                        c_ptr->feat = floor_type[randint0(100)];
-                                       c_ptr->info &= ~(CAVE_MASK);
-                                       c_ptr->info |= CAVE_FLOOR;
                                }
                        }
                }