OSDN Git Service

[Refactor] #38997 travel_step() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:24:01 +0000 (16:24 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:24:39 +0000 (16:24 +0900)
src/core.c
src/player-move.c
src/player-move.h

index a1b8666..647d244 100644 (file)
@@ -4687,7 +4687,7 @@ static void process_player(player_type *creature_ptr)
                else if (travel.run)
                {
                        /* Take a step */
-                       travel_step();
+                       travel_step(creature_ptr);
                }
 #endif
 
index cd6f46d..93474b4 100644 (file)
@@ -1997,7 +1997,7 @@ static DIRECTION travel_test(DIRECTION prev_dir)
  * Travel command
  * @return なし
  */
-void travel_step(void)
+void travel_step(player_type *creature_ptr)
 {
        /* Get travel direction */
        travel.dir = travel_test(travel.dir);
@@ -2009,15 +2009,15 @@ void travel_step(void)
                        msg_print(_("道筋が見つかりません!", "No route is found!"));
                        travel.y = travel.x = 0;
                }
-               disturb(p_ptr, FALSE, TRUE);
+               disturb(creature_ptr, FALSE, TRUE);
                return;
        }
 
-       take_turn(p_ptr, 100);
+       take_turn(creature_ptr, 100);
 
-       move_player(p_ptr, travel.dir, always_pickup, FALSE);
+       move_player(creature_ptr, travel.dir, always_pickup, FALSE);
 
-       if ((p_ptr->y == travel.y) && (p_ptr->x == travel.x))
+       if ((creature_ptr->y == travel.y) && (creature_ptr->x == travel.x))
        {
                travel.run = 0;
                travel.y = travel.x = 0;
index 8826c11..76f906e 100644 (file)
@@ -27,7 +27,7 @@ extern void search(player_type *creature_ptr);
 extern void carry(player_type *creature_ptr, bool pickup);
 #ifdef TRAVEL
 extern void do_cmd_travel(player_type *creature_ptr);
-extern void travel_step(void);
+extern void travel_step(player_type *creature_ptr);
 #endif
 
 /* Types of pattern tiles */