OSDN Git Service

[Refactor] #38997 get_is_floor() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Thu, 19 Dec 2019 09:58:10 +0000 (18:58 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 19 Dec 2019 09:58:10 +0000 (18:58 +0900)
src/floor.c
src/floor.h
src/grid.c
src/grid.h
src/rooms.c

index e03c8a9..0e3d54b 100644 (file)
@@ -1014,3 +1014,23 @@ void vault_trap_aux(floor_type *floor_ptr, POSITION y, POSITION x, POSITION yd,
                break;
        }
 }
+
+/*!
+ * @brief 指定のマスが床系地形であるかを返す / Function that sees if a square is a floor.  (Includes range checking.)
+ * @param x チェックするマスのX座標
+ * @param y チェックするマスのY座標
+ * @return 床系地形ならばTRUE
+ */
+bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y)
+{
+       if (!in_bounds(p_ptr->current_floor_ptr, y, x))
+       {
+               /* Out of bounds */
+               return (FALSE);
+       }
+
+       /* Do the real check */
+       if (is_floor_bold(p_ptr->current_floor_ptr, y, x)) return (TRUE);
+
+       return (FALSE);
+}
index 6d62b3e..71481c0 100644 (file)
@@ -395,3 +395,5 @@ extern void place_closed_door(floor_type *floor_ptr, POSITION y, POSITION x, int
 extern void wipe_o_list(floor_type *floor_ptr);
 extern void vault_trap_aux(floor_type *floor_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd);
 
+extern bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y);
+
index f0c44a0..9110f65 100644 (file)
@@ -413,26 +413,6 @@ void vault_traps(POSITION y, POSITION x, POSITION yd, POSITION xd, int num)
 }
 
 /*!
- * @brief 指定のマスが床系地形であるかを返す / Function that sees if a square is a floor.  (Includes range checking.)
- * @param x チェックするマスのX座標
- * @param y チェックするマスのY座標
- * @return 床系地形ならばTRUE
- */
-bool get_is_floor(POSITION x, POSITION y)
-{
-       if (!in_bounds(p_ptr->current_floor_ptr, y, x))
-       {
-               /* Out of bounds */
-               return (FALSE);
-       }
-
-       /* Do the real check */
-       if (is_floor_bold(p_ptr->current_floor_ptr, y, x)) return (TRUE);
-
-       return (FALSE);
-}
-
-/*!
  * @brief 指定のマスを床地形に変える / Set a square to be floor.  (Includes range checking.)
  * @param x 地形を変えたいマスのX座標
  * @param y 地形を変えたいマスのY座標
index 411d01e..4e78ff2 100644 (file)
@@ -374,7 +374,6 @@ extern void try_door(POSITION y, POSITION x);
 extern void vault_objects(POSITION y, POSITION x, int num);
 extern void vault_traps(POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
 
-extern bool get_is_floor(POSITION x, POSITION y);
 extern void set_floor(POSITION x, POSITION y);
 extern void place_bound_perm_wall(grid_type *g_ptr);
 
index d7e357d..bb069cc 100644 (file)
@@ -212,7 +212,7 @@ static void check_room_boundary(POSITION x1, POSITION y1, POSITION x2, POSITION
        bool old_is_floor, new_is_floor;
        count = 0;
 
-       old_is_floor = get_is_floor(x1 - 1, y1);
+       old_is_floor = get_is_floor(p_ptr->current_floor_ptr, x1 - 1, y1);
 
        /*
         * Count the number of floor-wall boundaries around the room
@@ -223,7 +223,7 @@ static void check_room_boundary(POSITION x1, POSITION y1, POSITION x2, POSITION
        /* Above the top boundary */
        for (x = x1; x <= x2; x++)
        {
-               new_is_floor = get_is_floor(x, y1 - 1);
+               new_is_floor = get_is_floor(p_ptr->current_floor_ptr, x, y1 - 1);
 
                /* Increment counter if they are different */
                if (new_is_floor != old_is_floor) count++;
@@ -234,7 +234,7 @@ static void check_room_boundary(POSITION x1, POSITION y1, POSITION x2, POSITION
        /* Right boundary */
        for (y = y1; y <= y2; y++)
        {
-               new_is_floor = get_is_floor(x2 + 1, y);
+               new_is_floor = get_is_floor(p_ptr->current_floor_ptr, x2 + 1, y);
 
                /* increment counter if they are different */
                if (new_is_floor != old_is_floor) count++;
@@ -245,7 +245,7 @@ static void check_room_boundary(POSITION x1, POSITION y1, POSITION x2, POSITION
        /* Bottom boundary */
        for (x = x2; x >= x1; x--)
        {
-               new_is_floor = get_is_floor(x, y2 + 1);
+               new_is_floor = get_is_floor(p_ptr->current_floor_ptr, x, y2 + 1);
 
                /* increment counter if they are different */
                if (new_is_floor != old_is_floor) count++;
@@ -256,7 +256,7 @@ static void check_room_boundary(POSITION x1, POSITION y1, POSITION x2, POSITION
        /* Left boundary */
        for (y = y2; y >= y1; y--)
        {
-               new_is_floor = get_is_floor(x1 - 1, y);
+               new_is_floor = get_is_floor(p_ptr->current_floor_ptr, x1 - 1, y);
 
                /* increment counter if they are different */
                if (new_is_floor != old_is_floor) count++;