]> granicus.if.org Git - nethack/commitdiff
fix 'simplify streamlined act_on_act()'
authorPatR <rankin@nethack.org>
Mon, 13 Jun 2022 21:44:20 +0000 (14:44 -0700)
committerPatR <rankin@nethack.org>
Mon, 13 Jun 2022 21:44:20 +0000 (14:44 -0700)
Still more PR #777.  Commit c4c6c3d73a broke #therecmdmenu travel,
throw, and far-look.  It was restricting dx and dy unnecessarily
and that resulted in not specifying the correct location when the
destination was farther than one step away.

Testing those properly requires a mouse.  I've implemented a way
to simulate a left or right click at getdir()'s prompt (only useful
for #therecmdmenu).  That will be committed separately.

src/cmd.c

index 75f312072d08b315b5cec9638018a579478f59d1..5a87efc3fe0b72fc1b50658da077c70b0efebc9f 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1,4 +1,4 @@
-/* NetHack 3.7 cmd.c   $NHDT-Date: 1655145035 2022/06/13 18:30:35 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.574 $ */
+/* NetHack 3.7 cmd.c   $NHDT-Date: 1655156619 2022/06/13 21:43:39 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.575 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -5093,7 +5093,8 @@ there_cmd_menu(int x, int y, int mod)
     char ch = '\0';
     int npick = 0, K = 0;
     menu_item *picks = (menu_item *) 0;
-    int dx = sgn(x - u.ux), dy = sgn(y - u.uy);
+    /*int dx = sgn(x - u.ux), dy = sgn(y - u.uy);*/
+    int dx = x - u.ux, dy = y - u.uy;
     int act = MCMD_NOTHING;
 
     win = create_nhwindow(NHW_MENU);