]> granicus.if.org Git - nethack/commitdiff
cancelled #herecmd using time
authorPatR <rankin@nethack.org>
Tue, 22 Mar 2022 01:33:34 +0000 (18:33 -0700)
committerPatR <rankin@nethack.org>
Tue, 22 Mar 2022 01:33:34 +0000 (18:33 -0700)
I managed to execute #herecmd by mistake and when I typed ESC to get
out of its menu, monsters took their next turn.  #therecmd behaved
similarly.

src/cmd.c

index 170019f6cce8e1bda8afbbfbb8eff2d6d2464a24..d5a6d642d99c704dfb6b62527b6b1848c3964aa4 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -4395,7 +4395,7 @@ doherecmdmenu(void)
 {
     char ch = here_cmd_menu(TRUE);
 
-    return ch ? ECMD_TIME : ECMD_OK;
+    return (ch && ch != '\033') ? ECMD_TIME : ECMD_OK;
 }
 
 /* #therecmdmenu command, a way to test there_cmd_menu without mouse */
@@ -4412,7 +4412,7 @@ dotherecmdmenu(void)
     else
         ch = here_cmd_menu(TRUE);
 
-    return ch ? ECMD_TIME : ECMD_OK;
+    return (ch && ch != '\033') ? ECMD_TIME : ECMD_OK;
 }
 
 static void