From f1bb0c1e470fd6d9bd55b1bf5c12dc28dd92dfdb Mon Sep 17 00:00:00 2001 From: deskull Date: Mon, 6 Jan 2020 00:49:09 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20prt=5Fpath()=20=E3=81=AB?= =?utf8?q?=20floor=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD?= =?utf8?q?=E5=8A=A0=20/=20Added=20floor=5Ftype=20*=20argument=20to=20prt?= =?utf8?q?=5Fpath().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/targeting.c | 4 ++-- src/view-mainwindow.c | 8 ++++---- src/view-mainwindow.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/targeting.c b/src/targeting.c index ba8a56684..7a7ac8cc2 100644 --- a/src/targeting.c +++ b/src/targeting.c @@ -1096,7 +1096,7 @@ bool target_set(BIT_FLAGS mode) /* Set forcus */ change_panel_xy(y, x); - if (!(mode & TARGET_LOOK)) prt_path(y, x); + if (!(mode & TARGET_LOOK)) prt_path(p_ptr->current_floor_ptr, y, x); /* Access */ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x]; @@ -1333,7 +1333,7 @@ bool target_set(BIT_FLAGS mode) { bool move_fast = FALSE; - if (!(mode & TARGET_LOOK)) prt_path(y, x); + if (!(mode & TARGET_LOOK)) prt_path(p_ptr->current_floor_ptr, y, x); /* Access */ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x]; diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index 16fe2a308..c04584110 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -3775,7 +3775,7 @@ void move_cursor_relative(int row, int col) /* * print project path */ -void prt_path(POSITION y, POSITION x) +void prt_path(floor_type *floor_ptr, POSITION y, POSITION x) { int i; int path_n; @@ -3787,7 +3787,7 @@ void prt_path(POSITION y, POSITION x) return; /* Get projection path */ - path_n = project_path(p_ptr->current_floor_ptr, path_g, (project_length ? project_length : MAX_RANGE), p_ptr->y, p_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU); + path_n = project_path(floor_ptr, path_g, (project_length ? project_length : MAX_RANGE), p_ptr->y, p_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU); p_ptr->redraw |= (PR_MAP); handle_stuff(); @@ -3797,7 +3797,7 @@ void prt_path(POSITION y, POSITION x) { POSITION ny = GRID_Y(path_g[i]); POSITION nx = GRID_X(path_g[i]); - grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx]; + grid_type *g_ptr = &floor_ptr->grid_array[ny][nx]; if (panel_contains(ny, nx)) { @@ -3807,7 +3807,7 @@ void prt_path(POSITION y, POSITION x) TERM_COLOR ta = default_color; char tc = '*'; - if (g_ptr->m_idx && p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml) + if (g_ptr->m_idx && floor_ptr->m_list[g_ptr->m_idx].ml) { /* Determine what is there */ map_info(ny, nx, &a, &c, &ta, &tc); diff --git a/src/view-mainwindow.h b/src/view-mainwindow.h index 017203fde..6b6d610e5 100644 --- a/src/view-mainwindow.h +++ b/src/view-mainwindow.h @@ -14,7 +14,7 @@ extern void prt_time(void); extern concptr map_name(void); extern void print_monster_list(floor_type *floor_ptr, TERM_LEN x, TERM_LEN y, TERM_LEN max_lines); extern void move_cursor_relative(int row, int col); -extern void prt_path(POSITION y, POSITION x); +extern void prt_path(floor_type *floor_ptr, POSITION y, POSITION x); extern void monster_race_track(MONRACE_IDX r_idx); extern void object_kind_track(KIND_OBJECT_IDX k_idx); extern void resize_map(void); -- 2.11.0