]> granicus.if.org Git - nethack/commitdiff
Fix mouse menu movement
authorPasi Kallinen <paxed@alt.org>
Fri, 20 Jan 2023 12:35:30 +0000 (14:35 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 20 Jan 2023 12:37:01 +0000 (14:37 +0200)
When using mouse to move to a location next to the hero,
the test_move result was reversed, causing the click to fall
in to the travel case instead of normal movement.

src/cmd.c

index 4d1fa6c81fe950fc36014f403cb3bded525a100e..37a99370b4f0a9422d746c489a13419f1c25d1cd 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -6014,7 +6014,7 @@ there_cmd_menu(coordxy x, coordxy y, int mod)
 
     if (!K) {
         /* no menu options, try to move */
-        if (next2u(x, y) && !test_move(u.ux, u.uy, dx, dy, TEST_MOVE)) {
+        if (next2u(x, y) && test_move(u.ux, u.uy, dx, dy, TEST_MOVE)) {
             int dir = xytod(dx, dy);
 
             cmdq_add_ec(CQ_CANNED, move_funcs[dir][MV_WALK]);