]> granicus.if.org Git - nethack/commitdiff
Make double fight prefix cancel out
authorPasi Kallinen <paxed@alt.org>
Mon, 7 Feb 2022 07:14:47 +0000 (09:14 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 7 Feb 2022 07:14:47 +0000 (09:14 +0200)
src/cmd.c

index 1fd6e3bcc8c5a3aaf8c145bb76bde97abab8368a..466639997ef67b3e46a6f04d9cc9bf310d83c97f 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -2081,6 +2081,13 @@ do_run(void)
 int
 do_fight(void)
 {
+    if (g.context.forcefight) {
+        Norep("Double fight prefix, canceled.");
+        g.context.forcefight = 1;
+        g.domove_attempting = 0;
+        return ECMD_CANCEL;
+    }
+
     g.context.forcefight = 1;
     g.domove_attempting |= DOMOVE_WALK;
     return ECMD_OK;