]> granicus.if.org Git - nethack/commitdiff
'travel' option
authorPatR <rankin@nethack.org>
Fri, 7 Feb 2020 22:37:51 +0000 (14:37 -0800)
committerPatR <rankin@nethack.org>
Fri, 7 Feb 2020 22:37:51 +0000 (14:37 -0800)
Change '!travel' to only prevent travel-by-mouse and leave '_' alone.

dat/opthelp
doc/Guidebook.mn
doc/Guidebook.tex
doc/fixes37.0
src/cmd.c

index 1048a19f92010ece1aacc8cabcf95709cdb74b1d..e2170af7848207358c6373f311e847ea71e35530 100644 (file)
@@ -64,8 +64,9 @@ status_updates update the status lines                            [TRUE]
 time           display elapsed game time, in moves                [FALSE]
 tombstone      print tombstone when you die                       [TRUE]
 toptenwin      print topten in a window rather than stdout        [FALSE]
-travel         enable the command to travel to a map location via [TRUE]
-               a shortest-path algorithm, usually invoked by '_'.
+travel         enables travelling via mouse click if supported;   [TRUE]
+               can be toggled off to prevent mouse clicks on the map from
+               attempting to move the hero; does not affect travel via '_'
 use_darkgray   use bold black instead of blue for black glyphs.   [TRUE]
 use_inverse    display detected monsters in highlighted manner    [FALSE]
 verbose        print more commentary during the game              [TRUE]
index fd906d9c82cf32e561a9a8eaf0a21bb66fa15e75..f4901601a146e139f08c12ca5ca6a4cd98d15dba 100644 (file)
@@ -3771,9 +3771,11 @@ Setting this option makes the score list visible when a windowing version
 of NetHack is started without a parent window, but it no longer leaves
 the score list around after game end on a terminal or emulating window.
 .lp travel
-Allow the travel command (default on).  Turning this option off will
-prevent the game from attempting unintended moves if you make inadvertent
-mouse clicks on the map window.  Persistent.
+Allow the travel command via mouse click (default on).
+Turning this option off will prevent the game from attempting unintended
+moves if you make inadvertent mouse clicks on the map window.
+Does not affect traveling via the \(oq\f(CR_\fP\(cq (\(lq#travel\(rq) command.
+Persistent.
 ." .lp travel_debug
 ." Display intended path during each step of travel (default off).
 ." Debug mode only.
index 7caa15d8fe3ac17659b326bf63ae73a908a5d51c..97eab4d2429e0e0f9347113e39422a8535c7027c 100644 (file)
@@ -4064,9 +4064,11 @@ of {\it NetHack\/} is started without a parent window, but it no longer leaves
 the score list around after game end on a terminal or emulating window.
 %.lp
 \item[\ib{travel}]
-Allow the travel command (default on).  Turning this option off will
-prevent the game from attempting unintended moves if you make inadvertent
-mouse clicks on the map window.  Persistent.
+Allow the travel command via mouse click (default on).
+Turning this option off will prevent the game from attempting unintended
+moves if you make inadvertent mouse clicks on the map window.
+Does not affect traveling via the `{\tt \verb+_+}' (``{\tt \#travel}'')
+command.  Persistent.
 % %.lp
 % \item[ib{travel\verb+_+debug}]
 % Display intended path during each step of travel (default off).
index d20c94caa3c84345eb67d9681d0c779c4c64648a..24682e3246ddb3121a53d0c70d4939d3325d47a1 100644 (file)
@@ -142,6 +142,8 @@ new 'mention_decor' option; when On, describe dungeon features being stepped
        on or floated/flown over even when they're not covered by objects
 applying royal jelly on an egg kills, revives, or changes the egg
 intelligent monsters pick up and rummage through containers
+toggling 'travel' option Off now only inhibits travel by mouse click, not by
+       '_' command where choosing the destination provides a chance to cancel
 
 
 Platform- and/or Interface-Specific New Features
index a619b42a460bb2fa1f4a40c506c43501acde23f7..34bedb28473b5e68f4e459fef4283c2335053383 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -3162,15 +3162,12 @@ register char *cmd;
         }
         return;
     case NHKF_TRAVEL:
-        if (flags.travelcmd) {
-            g.context.travel = 1;
-            g.context.travel1 = 1;
-            g.context.run = 8;
-            g.context.nopick = 1;
-            g.domove_attempting |= DOMOVE_RUSH;
-            break;
-        }
-        /*FALLTHRU*/
+        g.context.travel = 1;
+        g.context.travel1 = 1;
+        g.context.run = 8;
+        g.context.nopick = 1;
+        g.domove_attempting |= DOMOVE_RUSH;
+        break;
     default:
         if (movecmd(*cmd)) { /* ordinary movement */
             g.context.run = 0; /* only matters here if it was 8 */
@@ -4302,14 +4299,16 @@ dotravel(VOID_ARGS)
     static char cmd[2];
     coord cc;
 
-    /* [FIXME?  Supporting the ability to disable traveling via mouse
-       click makes some sense, depending upon overall mouse usage.
-       Disabling '_' on a user by user basis makes no sense at all since
-       even if it is typed by accident, aborting when picking a target
-       destination is trivial.  Travel via mouse predates travel via '_',
-       and this use of OPTION=!travel is probably just a mistake....] */
-    if (!flags.travelcmd)
-        return 0;
+    /*
+     * Travelling used to be a no-op if user toggled 'travel' option
+     * Off.  However, travel was initially implemented as a mouse-only
+     * command and the original purpose of the option was to be able
+     * to prevent clicks on the map from initiating travel.
+     *
+     * Travel via '_' came later.  Since it requires a destination--
+     * which offers the user a chance to cancel if it was accidental--
+     * there's no reason for the option to disable travel-by-keys.
+     */
 
     cmd[1] = 0;
     cc.x = iflags.travelcc.x;