cmdassist enhancement
Implement the patch sent by <email deleted> to make responding with '?' at the "what direction?" prompt ask again after giving the `cmdassist' direction display. I did it slightly differently than was done in the submitted patch but the result is the same except that it also suppresses the message about how to disable cmdassist in this case.
This commit is contained in:
@@ -22,6 +22,7 @@ Platform- and/or Interface-Specific Fixes
|
||||
General New Features
|
||||
--------------------
|
||||
when you're teetering on the edge of a pit you can use '>' to enter the pit
|
||||
when asked for a direction, a response of '?' yields help and then asks again
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific New Features
|
||||
|
||||
33
src/cmd.c
33
src/cmd.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)cmd.c 3.4 2003/04/02 */
|
||||
/* SCCS Id: @(#)cmd.c 3.4 2004/01/09 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2084,30 +2084,35 @@ const char *s;
|
||||
{
|
||||
char dirsym;
|
||||
|
||||
retry:
|
||||
#ifdef REDO
|
||||
if(in_doagain || *readchar_queue)
|
||||
if (in_doagain || *readchar_queue)
|
||||
dirsym = readchar();
|
||||
else
|
||||
#endif
|
||||
dirsym = yn_function ((s && *s != '^') ? s : "In what direction?",
|
||||
dirsym = yn_function((s && *s != '^') ? s : "In what direction?",
|
||||
(char *)0, '\0');
|
||||
#ifdef REDO
|
||||
savech(dirsym);
|
||||
#endif
|
||||
if(dirsym == '.' || dirsym == 's')
|
||||
u.dx = u.dy = u.dz = 0;
|
||||
else if(!movecmd(dirsym) && !u.dz) {
|
||||
boolean did_help = FALSE;
|
||||
if(!index(quitchars, dirsym)) {
|
||||
if (iflags.cmdassist) {
|
||||
did_help = help_dir((s && *s == '^') ? dirsym : 0,
|
||||
if (dirsym == '.' || dirsym == 's') {
|
||||
u.dx = u.dy = u.dz = 0;
|
||||
} else if (!movecmd(dirsym) && !u.dz) {
|
||||
boolean did_help = FALSE, help_requested;
|
||||
|
||||
if (!index(quitchars, dirsym)) {
|
||||
help_requested = (dirsym == '?');
|
||||
if (help_requested || iflags.cmdassist) {
|
||||
did_help = help_dir((s && *s == '^') ? dirsym : 0,
|
||||
help_requested ? (const char *)0 :
|
||||
"Invalid direction key!");
|
||||
}
|
||||
if (!did_help) pline("What a strange direction!");
|
||||
if (help_requested) goto retry;
|
||||
}
|
||||
return 0;
|
||||
if (!did_help) pline("What a strange direction!");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if(!u.dz && (Stunned || (Confusion && !rn2(5)))) confdir();
|
||||
if (!u.dz && (Stunned || (Confusion && !rn2(5)))) confdir();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user