]> granicus.if.org Git - nethack/commitdiff
Pre-populate teleport destination prompt with travel destination
authorPasi Kallinen <paxed@alt.org>
Fri, 16 Oct 2020 16:10:17 +0000 (19:10 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 16 Oct 2020 16:14:01 +0000 (19:14 +0300)
This has been implemented in multiple variants, and seems like
a small but useful quality of life improvement.

doc/fixes37.0
src/teleport.c

index 905af14911d88f8f703cbc04ea9c9a1c4ede2482..f9c67c9461c50262e36c6333fc283fa6ebb40693 100644 (file)
@@ -276,6 +276,7 @@ when reporting that hero can't repair a chest's broken lock with key/pick/card
        just describe the base item without BUC, user assigned name, &c since
        "You can't repair a chest's lock with an uncursed key." implicitly
        suggests that you might be able to do so with a blessed or cursed one
+pre-populate teleport destination prompt with travel destination
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index f51001a7e8345de294dabb2ee03bd84eeec5a434..e72ac2d387f1fd730c9d45b894e0d72f5d0e0f6a 100644 (file)
@@ -528,6 +528,11 @@ struct obj *scroll;
                 learnscroll(scroll);
             cc.x = u.ux;
             cc.y = u.uy;
+            if (iflags.travelcc.x != 0 || iflags.travelcc.y != 0) {
+                /* The player showed some interest in traveling here;
+                 * pre-suggest this coordinate. */
+                cc = iflags.travelcc;
+            }
             if (getpos(&cc, TRUE, "the desired position") < 0)
                 return; /* abort */
             /* possible extensions: introduce a small error if