OSDN Git Service

[Refactor] #38997 prt_path() に floor_type * 引数を追加 / Added floor_type * argument to...
authordeskull <deskull@users.sourceforge.jp>
Sun, 5 Jan 2020 15:49:09 +0000 (00:49 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 5 Jan 2020 15:49:09 +0000 (00:49 +0900)
src/targeting.c
src/view-mainwindow.c
src/view-mainwindow.h

index ba8a566..7a7ac8c 100644 (file)
@@ -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];
index 16fe2a3..c045841 100644 (file)
@@ -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);
index 017203f..6b6d610 100644 (file)
@@ -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);