if (emptyflag && one_in_(2))
{
/* Build the vault */
- build_small_room(x0, y0);
+ build_small_room(floor_ptr, x0, y0);
/* Place a treasure in the vault */
place_object(y0, x0, 0L);
/* make a few rooms in the vault */
for (i = 1; i <= (xsize * ysize) / 50; i++)
{
- build_small_room(x0 + randint0(xsize - 4) - xsize / 2 + 2,
+ build_small_room(floor_ptr, x0 + randint0(xsize - 4) - xsize / 2 + 2,
y0 + randint0(ysize - 4) - ysize / 2 + 2);
}
/*!
* @brief 1マスだけの部屋を作成し、上下左右いずれか一つに隠しドアを配置する。
+ * @param floor_ptr 配置するフロアの参照ポインタ
* @param y0 配置したい中心のY座標
* @param x0 配置したい中心のX座標
* @details
* Note - this should be used only on allocated regions
* within another room.
*/
-void build_small_room(POSITION x0, POSITION y0)
+void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0)
{
POSITION x, y;
/* Place a secret door on one side */
switch (randint0(4))
{
- case 0: place_secret_door(p_ptr->current_floor_ptr, y0, x0 - 1, DOOR_DEFAULT); break;
- case 1: place_secret_door(p_ptr->current_floor_ptr, y0, x0 + 1, DOOR_DEFAULT); break;
- case 2: place_secret_door(p_ptr->current_floor_ptr, y0 - 1, x0, DOOR_DEFAULT); break;
- case 3: place_secret_door(p_ptr->current_floor_ptr, y0 + 1, x0, DOOR_DEFAULT); break;
+ case 0: place_secret_door(floor_ptr, y0, x0 - 1, DOOR_DEFAULT); break;
+ case 1: place_secret_door(floor_ptr, y0, x0 + 1, DOOR_DEFAULT); break;
+ case 2: place_secret_door(floor_ptr, y0 - 1, x0, DOOR_DEFAULT); break;
+ case 3: place_secret_door(floor_ptr, y0 + 1, x0, DOOR_DEFAULT); break;
}
/* Clear mimic type */
- p_ptr->current_floor_ptr->grid_array[y0][x0].mimic = 0;
+ floor_ptr->grid_array[y0][x0].mimic = 0;
/* Add inner open space */
place_floor_bold(y0, x0);
extern bool generate_rooms(floor_type *floor_ptr);
extern void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault);
extern bool find_space(POSITION *y, POSITION *x, POSITION height, POSITION width);
-extern void build_small_room(POSITION x0, POSITION y0);
+extern void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0);
extern void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2);
extern POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4);
extern void generate_room_floor(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light);