OSDN Git Service

[Refactor] #38997 place_solid_perm_grid() を削除し、place_grid() に統合 / Removed place_outer...
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 08:38:33 +0000 (17:38 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 14:01:53 +0000 (23:01 +0900)
src/grid.c
src/grid.h
src/rooms-fractal.c
src/rooms-fractal.h
src/rooms-normal.h
src/rooms.c

index 237db15..b7730f7 100644 (file)
@@ -257,7 +257,7 @@ void place_bound_perm_wall(grid_type *g_ptr)
        }
 
        /* Add "solid" perma-wall */
-       place_solid_perm_grid(g_ptr);
+       place_grid(g_ptr, solid_perm);
 }
 
 /*!
@@ -1208,15 +1208,6 @@ bool player_can_enter(player_type *creature_ptr, FEAT_IDX feature, BIT_FLAGS16 m
 }
 
 
-void place_solid_perm_grid(grid_type *g_ptr)
-{
-       g_ptr->feat = feat_permanent;
-       g_ptr->info &= ~(CAVE_MASK);
-       g_ptr->info |= CAVE_SOLID;
-       if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
-}
-
-
 void place_grid(grid_type *g_ptr, place_grid_type pg_type)
 {
        switch (pg_type)
@@ -1277,7 +1268,7 @@ void place_grid(grid_type *g_ptr, place_grid_type pg_type)
        }
 
        g_ptr->info &= ~(CAVE_MASK);
-       if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
+       if (g_ptr->m_idx > 0) delete_monster_idx(g_ptr->m_idx);
 }
 
 
index e681b5a..0a83122 100644 (file)
@@ -317,7 +317,6 @@ typedef enum place_grid_type
        solid_perm
 } place_grid_type;
 
-extern void place_solid_perm_grid(grid_type *g_ptr);
 extern void place_grid(grid_type *g_ptr, place_grid_type pg_type);
 extern bool darkened_grid(player_type *player_ptr, grid_type *g_ptr);
 
index f25ba08..4b38881 100644 (file)
@@ -10,7 +10,7 @@
 * @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal grid
 * @return なし
 */
-bool build_type9(floor_type *floor_ptr)
+bool build_type9(player_type *player_ptr)
 {
        int grd, roug, cutoff;
        POSITION xsize, ysize, y0, x0;
@@ -22,6 +22,7 @@ bool build_type9(floor_type *floor_ptr)
        ysize = randint1(15) * 2 + 6;
 
        /* Find and reserve some space in the dungeon.  Get center of room. */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (!find_space(floor_ptr, &y0, &x0, ysize + 1, xsize + 1))
        {
                /* Limit to the minimum room size, and retry */
@@ -35,7 +36,7 @@ bool build_type9(floor_type *floor_ptr)
                        * Still no space?!
                        * Try normal room
                        */
-                       return build_type1(floor_ptr);
+                       return build_type1(player_ptr);
                }
        }
 
index d4cb038..131bd20 100644 (file)
@@ -1,2 +1 @@
-
-extern bool build_type9(floor_type *floor_ptr);
+extern bool build_type9(player_type *player_ptr);
index 624ea9a..1f88988 100644 (file)
@@ -1,4 +1,4 @@
-extern bool build_type1(floor_type *floor_ptr);
+extern bool build_type1(player_type *player_ptr);
 extern bool build_type2(floor_type *floor_ptr);
 extern bool build_type3(player_type *player_ptr);
 extern bool build_type4(player_type *player_ptr);
index c2c5c25..745ebfe 100644 (file)
@@ -2058,7 +2058,7 @@ static bool room_build(player_type *player_ptr, EFFECT_ID typ)
        switch (typ)
        {
                /* Build an appropriate room */
-       case ROOM_T_NORMAL:        return build_type1(floor_ptr);
+       case ROOM_T_NORMAL:        return build_type1(player_ptr);
        case ROOM_T_OVERLAP:       return build_type2(floor_ptr);
        case ROOM_T_CROSS:         return build_type3(player_ptr);
        case ROOM_T_INNER_FEAT:    return build_type4(player_ptr);
@@ -2066,7 +2066,7 @@ static bool room_build(player_type *player_ptr, EFFECT_ID typ)
        case ROOM_T_PIT:           return build_type6(player_ptr);
        case ROOM_T_LESSER_VAULT:  return build_type7(player_ptr);
        case ROOM_T_GREATER_VAULT: return build_type8(player_ptr);
-       case ROOM_T_FRACAVE:       return build_type9(floor_ptr);
+       case ROOM_T_FRACAVE:       return build_type9(player_ptr);
        case ROOM_T_RANDOM_VAULT:  return build_type10(player_ptr);
        case ROOM_T_OVAL:          return build_type11(floor_ptr);
        case ROOM_T_CRYPT:         return build_type12(player_ptr);