of tracking wand zaps if a teleportation zap hit an object; subsequent
zap traversal was done from object's landing spot rather than from its
zap hit spot, resulting in scrambled wand targetting
+restore previous behavior of the 'altmeta' option (only wait for a second
+ character when getting a command keystroke, not other key input)
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
/* for rejecting #if !SHELL, !SUSPEND */
static const char cmdnotavail[] = "'%s' command not available.";
+/* only needed for #if ALTMETA config but present unconditionally */
+static boolean getting_cmd = FALSE; /* True when parse() gets next command */
+
static int
doprev_message(void)
{
g.context.move = 1;
flush_screen(1); /* Flush screen buffer. Put the cursor on the hero. */
+ getting_cmd = TRUE; /* affects readchar() behavior if the 'altmeta'
+ * option is On; reset to False by readchar() */
if (!g.Cmd.num_pad || (foo = readchar()) == g.Cmd.spkeys[NHKF_COUNT]) {
- foo = get_count((char *) 0, '\0', LARGEST_INT, &g.command_count, FALSE);
+ foo = get_count((char *) 0, '\0', LARGEST_INT,
+ &g.command_count, FALSE);
g.last_command_count = g.command_count;
}
#endif
sym = '\033';
#ifdef ALTMETA
- } else if (sym == '\033' && iflags.altmeta) {
- /* iflags.altmeta: treat two character ``ESC c'' as single `M-c' */
+ } else if (sym == '\033' && iflags.altmeta && getting_cmd) {
+ /* iflags.altmeta: treat two character ``ESC c'' as single `M-c' but
+ only when we're called by parse() [possibly via get_count()] */
sym = *readchar_queue ? *readchar_queue++ : pgetchar();
if (sym == EOF || sym == 0)
sym = '\033';
readchar_queue = click_to_cmd(*x, *y, *mod);
sym = *readchar_queue++;
}
+ getting_cmd = FALSE; /* next readchar() will be for an ordinary char
+ * unless parse() sets this back to True */
return (char) sym;
}