OSDN Git Service

Modify travel command
authorhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 8 Mar 2013 12:05:28 +0000 (12:05 +0000)
committerhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 8 Mar 2013 12:05:28 +0000 (12:05 +0000)
- We can continue traveling to the previously designated place
  when being disturbed traveling

src/cmd1.c
src/cmd2.c
src/floors.c

index 49362cd..473b395 100644 (file)
@@ -4817,6 +4817,7 @@ void travel_step(void)
 #else
                        msg_print("No route is found!");
 #endif
+                       travel.y = travel.x = 0;
                }
                disturb(0, 1);
                return;
@@ -4827,7 +4828,10 @@ void travel_step(void)
        move_player(travel.dir, always_pickup, FALSE);
 
        if ((py == travel.y) && (px == travel.x))
+       {
                travel.run = 0;
+               travel.y = travel.x = 0;
+       }
        else if (travel.run > 0)
                travel.run--;
 
index 760c6f5..1d24fc5 100644 (file)
@@ -4794,8 +4794,10 @@ void forget_travel_flow(void)
                {
                        /* Forget the old data */
                        travel.cost[y][x] = MAX_SHORT;
-               }       
+               }
        }
+
+       travel.y = travel.x = 0;
 }
 
 static int travel_flow_cost(int y, int x)
@@ -4931,7 +4933,13 @@ void do_cmd_travel(void)
        int dx, dy, sx, sy;
        feature_type *f_ptr;
 
-       if (!tgt_pt(&x, &y)) return;
+       if (travel.x != 0 && travel.y != 0 &&
+           get_check(_("¥È¥é¥Ù¥ë¤ò·Ñ³¤·¤Þ¤¹¤«¡©", "Do you continue to travel?")))
+       {
+               y = travel.y;
+               x = travel.x;
+       }
+       else if (!tgt_pt(&x, &y)) return;
 
        if ((x == px) && (y == py))
        {
@@ -4958,12 +4966,12 @@ void do_cmd_travel(void)
                return;
        }
 
-       travel.x = x;
-       travel.y = y;
-
        forget_travel_flow();
        travel_flow(y, x);
 
+       travel.x = x;
+       travel.y = y;
+
        /* Travel till 255 steps */
        travel.run = 255;
 
index 681d915..5873e79 100644 (file)
@@ -1389,6 +1389,9 @@ void change_floor(void)
        /* Place preserved pet monsters */
        place_pet();
 
+       /* Reset travel target place */
+       forget_travel_flow();
+
        /* Hack -- maintain unique and artifacts */
        update_unique_artifact(new_floor_id);