]> granicus.if.org Git - nethack/commitdiff
Reset travel destination if reached via teleport
authorPasi Kallinen <paxed@alt.org>
Sat, 17 Oct 2020 09:08:47 +0000 (12:08 +0300)
committerPasi Kallinen <paxed@alt.org>
Sat, 17 Oct 2020 09:08:51 +0000 (12:08 +0300)
src/teleport.c

index e72ac2d387f1fd730c9d45b894e0d72f5d0e0f6a..8157f512c9460119227fe92b73e78b9b29dd1de7 100644 (file)
@@ -528,7 +528,7 @@ struct obj *scroll;
                 learnscroll(scroll);
             cc.x = u.ux;
             cc.y = u.uy;
-            if (iflags.travelcc.x != 0 || iflags.travelcc.y != 0) {
+            if (isok(iflags.travelcc.x, iflags.travelcc.y)) {
                 /* The player showed some interest in traveling here;
                  * pre-suggest this coordinate. */
                 cc = iflags.travelcc;
@@ -540,6 +540,7 @@ struct obj *scroll;
             if (teleok(cc.x, cc.y, FALSE)) {
                 /* for scroll, discover it regardless of destination */
                 teleds(cc.x, cc.y, TELEDS_TELEPORT);
+                iflags.travelcc.x = iflags.travelcc.y = 0;
                 return;
             }
             pline("Sorry...");