]> granicus.if.org Git - nethack/commitdiff
Fix: command counts greater than 2
authorMichael Meyer <me@entrez.cc>
Thu, 4 Aug 2022 17:53:12 +0000 (13:53 -0400)
committerPasi Kallinen <paxed@alt.org>
Sat, 6 Aug 2022 13:42:17 +0000 (16:42 +0300)
Entering a count to repeat an action stopped working for counts greater
than 2 after 93db2a8: the unconditional call to reset_cmd_vars at the
top of rhack was resetting many more variables than had previously been
cleared at that point, including g.multi (which in this context tracks
how many more times the requested action should be repeated).  As a
result any count would perform the requested action twice at most.
Reduce the list of variables zeroed out at the start of rhack back to
what it was before 93db2a8.

src/cmd.c

index fe8a42c40c4a2fd0657df4e76159a0716ddb77c8..4428a27b6ecec8547f7d301120a4f2450cb587fb 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -4473,7 +4473,8 @@ rhack(char *cmd)
     const struct ext_func_tab *cmdq_ec = 0, *prefix_seen = 0;
     boolean was_m_prefix = FALSE;
 
-    reset_cmd_vars(FALSE);
+    iflags.menu_requested = FALSE;
+    g.context.nopick = 0;
  got_prefix_input:
 #ifdef SAFERHANGUP
     if (g.program_state.done_hup)