From 762d53ac09992a28aba59a649c8270be5ec03a8e Mon Sep 17 00:00:00 2001 From: deskull Date: Fri, 3 Jan 2020 23:20:44 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20next=5Fto=5Fcorr()=20?= =?utf8?q?=E3=81=AB=20player=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=20player=5Ftype=20*=20argu?= =?utf8?q?ment=20to=20next=5Fto=5Fcorr().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/floor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/floor.c b/src/floor.c index 9327c08c1..0c55e5cae 100644 --- a/src/floor.c +++ b/src/floor.c @@ -1040,13 +1040,13 @@ bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y) * @param y1 基準となるマスのY座標 * @param x1 基準となるマスのX座標 * @return 通路の数 -* @note Assumes "in_bounds(p_ptr->current_floor_ptr, y1, x1)" +* @note Assumes "in_bounds(y1, x1)" * @details * XXX XXX This routine currently only counts actual "empty floor"\n * grids which are not in rooms. We might want to also count stairs,\n * open doors, closed doors, etc. */ -static int next_to_corr(POSITION y1, POSITION x1) +static int next_to_corr(floor_type *floor_ptr, POSITION y1, POSITION x1) { int i, k = 0; POSITION y, x; @@ -1058,7 +1058,7 @@ static int next_to_corr(POSITION y1, POSITION x1) { y = y1 + ddy_ddd[i]; x = x1 + ddx_ddd[i]; - g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x]; + g_ptr = &floor_ptr->grid_array[y][x]; /* Skip non floors */ if (cave_have_flag_grid(g_ptr, FF_WALL)) continue; @@ -1091,7 +1091,7 @@ static int next_to_corr(POSITION y1, POSITION x1) static bool possible_doorway(floor_type *floor_ptr, POSITION y, POSITION x) { /* Count the adjacent corridors */ - if (next_to_corr(y, x) >= 2) + if (next_to_corr(floor_ptr, y, x) >= 2) { /* Check Vertical */ if (cave_have_flag_bold(floor_ptr, y - 1, x, FF_WALL) && -- 2.11.0