From 8c54cc43f4cd4ae723961e32fbec1989bcb63ea6 Mon Sep 17 00:00:00 2001 From: deskull Date: Fri, 27 Sep 2019 19:28:01 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20alloc=5Fstairs=5Faux()=20?= =?utf8?q?=E3=81=AB=20floor=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8E=20/=20Add=20floor=5Ftype=20*=20argum?= =?utf8?q?ent=20to=20alloc=5Fstairs=5Faux().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/floor-generate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/floor-generate.c b/src/floor-generate.c index 610edc014..44236ef09 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -166,9 +166,9 @@ static int next_to_walls(floor_type* floor_ptr, POSITION y, POSITION x) * @param walls 最低減隣接させたい外壁の数 * @return 階段を生成して問題がないならばTRUEを返す。 */ -static bool alloc_stairs_aux(POSITION y, POSITION x, int walls) +static bool alloc_stairs_aux(floor_type *floor_ptr, POSITION y, POSITION x, int walls) { - grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x]; + grid_type *g_ptr = &floor_ptr->grid_array[y][x]; /* Require "naked" floor grid */ if (!is_floor_grid(g_ptr)) return FALSE; @@ -176,7 +176,7 @@ static bool alloc_stairs_aux(POSITION y, POSITION x, int walls) if (g_ptr->o_idx || g_ptr->m_idx) return FALSE; /* Require a certain number of adjacent walls */ - if (next_to_walls(p_ptr->current_floor_ptr, y, x) < walls) return FALSE; + if (next_to_walls(floor_ptr, y, x) < walls) return FALSE; return TRUE; } @@ -242,7 +242,7 @@ static bool alloc_stairs(floor_type *floor_ptr, FEAT_IDX feat, int num, int wall { for (x = 1; x < floor_ptr->width - 1; x++) { - if (alloc_stairs_aux(y, x, walls)) + if (alloc_stairs_aux(floor_ptr, y, x, walls)) { /* A valid space found */ candidates++; @@ -268,7 +268,7 @@ static bool alloc_stairs(floor_type *floor_ptr, FEAT_IDX feat, int num, int wall { for (x = 1; x < floor_ptr->width - 1; x++) { - if (alloc_stairs_aux(y, x, walls)) + if (alloc_stairs_aux(floor_ptr, y, x, walls)) { pick--; -- 2.11.0