From: nethack.rankin Date: Thu, 12 May 2005 03:16:05 +0000 (+0000) Subject: stale prompt revisited X-Git-Tag: MOVE2GIT~1271 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b4ca7f6eb4465ba9e108df8b0d0d86bb6c5f98d;p=nethack stale prompt revisited Further discussion in the newsgroup pointed out a case not involving where the "In what direction?" prompt remained displayed after it was no longer applicable: throwing something where there's no monster target in the line of fire. You don't get any hit or miss message in a case like that, so the last message (the prompt) stays in view. I don't think there are any cases where getdir()'s caller deliberately wants to leave the old prompt up, so just clear it unconditionally as soon as the user answers. --- diff --git a/src/cmd.c b/src/cmd.c index de8ee9998..abdd0a5d7 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2178,6 +2178,8 @@ const char *s; #endif dirsym = yn_function((s && *s != '^') ? s : "In what direction?", (char *)0, '\0'); + /* remove the prompt string so caller won't have to */ + clear_nhwindow(WIN_MESSAGE); if (redraw_cmd(dirsym)) { /* ^R */ docrt(); /* redraw */ @@ -2192,10 +2194,7 @@ const char *s; } else if (!movecmd(dirsym) && !u.dz) { boolean did_help = FALSE, help_requested; - if (index(quitchars, dirsym)) { - /* remove the prompt string */ - clear_nhwindow(WIN_MESSAGE); - } else { + if (!index(quitchars, dirsym)) { help_requested = (dirsym == '?'); if (help_requested || iflags.cmdassist) { did_help = help_dir((s && *s == '^') ? dirsym : 0,