OSDN Git Service

[Refactor] #38997 print_path() にplayer_type * 引数を追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 14:42:22 +0000 (23:42 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 16:06:59 +0000 (01:06 +0900)
src/targeting.c
src/view-mainwindow.c
src/view-mainwindow.h

index 3629484..eb1a5c3 100644 (file)
@@ -1098,7 +1098,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                        /* Set forcus */
                        change_panel_xy(creature_ptr, y, x);
 
-                       if (!(mode & TARGET_LOOK)) print_path(floor_ptr, y, x);
+                       if (!(mode & TARGET_LOOK)) print_path(creature_ptr, y, x);
 
                        /* Access */
                        g_ptr = &floor_ptr->grid_array[y][x];
@@ -1336,7 +1336,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                {
                        bool move_fast = FALSE;
 
-                       if (!(mode & TARGET_LOOK)) print_path(floor_ptr, y, x);
+                       if (!(mode & TARGET_LOOK)) print_path(creature_ptr, y, x);
 
                        /* Access */
                        g_ptr = &floor_ptr->grid_array[y][x];
index 65d13ac..d63ade5 100644 (file)
@@ -3816,7 +3816,7 @@ void move_cursor_relative(int row, int col)
 /*
  * print project path
  */
-void print_path(floor_type *floor_ptr, POSITION y, POSITION x)
+void print_path(player_type *player_ptr, POSITION y, POSITION x)
 {
        int i;
        int path_n;
@@ -3828,10 +3828,11 @@ void print_path(floor_type *floor_ptr, POSITION y, POSITION x)
                return;
 
        /* Get projection path */
-       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);
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
+       path_n = project_path(floor_ptr, path_g, (project_length ? project_length : MAX_RANGE), player_ptr->y, player_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU);
 
-       p_ptr->redraw |= (PR_MAP);
-       handle_stuff(p_ptr);
+       player_ptr->redraw |= (PR_MAP);
+       handle_stuff(player_ptr);
 
        /* Draw path */
        for (i = 0; i < path_n; i++)
@@ -3864,8 +3865,8 @@ void print_path(floor_type *floor_ptr, POSITION y, POSITION x)
                        if (!use_graphics)
                        {
                                if (current_world_ptr->timewalk_m_idx) a = TERM_DARK;
-                               else if (IS_INVULN(p_ptr) || p_ptr->timewalk) a = TERM_WHITE;
-                               else if (p_ptr->wraith_form) a = TERM_L_DARK;
+                               else if (IS_INVULN(player_ptr) || player_ptr->timewalk) a = TERM_WHITE;
+                               else if (player_ptr->wraith_form) a = TERM_L_DARK;
                        }
 
                        c = '*';
index 21bbbc7..5622b1a 100644 (file)
@@ -12,7 +12,7 @@ extern void print_time(void);
 extern concptr map_name(player_type *creature_ptr);
 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 print_path(floor_type *floor_ptr, POSITION y, POSITION x);
+extern void print_path(player_type *player_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);