From: Michael Meyer Date: Thu, 4 Aug 2022 17:34:06 +0000 (-0400) Subject: Fix: get_count and altmeta X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=76d9d6588439272074ebd7372e8385900c7330b9;p=nethack Fix: get_count and altmeta M- shortcuts with altmeta enabled weren't working when preceded by a count (e.g. 2 M-j for "jump twice"): g.program_state.getting_a_command determined whether should be read as staring a potential meta key combination, and was being reset by readchar on the first digit entered without being reactivated for subsequent input. As a result, by the time the player entered the actual command to be modified by the count, readchar wasn't bothering to look for M- sequences. --- diff --git a/src/cmd.c b/src/cmd.c index be1da5423..fe8a42c40 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -5805,8 +5805,11 @@ get_count( if (inkey) { key = inkey; inkey = '\0'; - } else + } else { + g.program_state.getting_a_command = 1; /* readchar altmeta + * compatibility */ key = readchar(); + } if (digit(key)) { cnt = 10L * cnt + (long) (key - '0');