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
|
General New Features
|
||||||
--------------------
|
--------------------
|
||||||
when you're teetering on the edge of a pit you can use '>' to enter the pit
|
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
|
Platform- and/or Interface-Specific New Features
|
||||||
|
|||||||
@@ -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. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -2084,30 +2084,35 @@ const char *s;
|
|||||||
{
|
{
|
||||||
char dirsym;
|
char dirsym;
|
||||||
|
|
||||||
|
retry:
|
||||||
#ifdef REDO
|
#ifdef REDO
|
||||||
if(in_doagain || *readchar_queue)
|
if (in_doagain || *readchar_queue)
|
||||||
dirsym = readchar();
|
dirsym = readchar();
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
dirsym = yn_function ((s && *s != '^') ? s : "In what direction?",
|
dirsym = yn_function((s && *s != '^') ? s : "In what direction?",
|
||||||
(char *)0, '\0');
|
(char *)0, '\0');
|
||||||
#ifdef REDO
|
#ifdef REDO
|
||||||
savech(dirsym);
|
savech(dirsym);
|
||||||
#endif
|
#endif
|
||||||
if(dirsym == '.' || dirsym == 's')
|
if (dirsym == '.' || dirsym == 's') {
|
||||||
u.dx = u.dy = u.dz = 0;
|
u.dx = u.dy = u.dz = 0;
|
||||||
else if(!movecmd(dirsym) && !u.dz) {
|
} else if (!movecmd(dirsym) && !u.dz) {
|
||||||
boolean did_help = FALSE;
|
boolean did_help = FALSE, help_requested;
|
||||||
if(!index(quitchars, dirsym)) {
|
|
||||||
if (iflags.cmdassist) {
|
if (!index(quitchars, dirsym)) {
|
||||||
did_help = help_dir((s && *s == '^') ? dirsym : 0,
|
help_requested = (dirsym == '?');
|
||||||
|
if (help_requested || iflags.cmdassist) {
|
||||||
|
did_help = help_dir((s && *s == '^') ? dirsym : 0,
|
||||||
|
help_requested ? (const char *)0 :
|
||||||
"Invalid direction key!");
|
"Invalid direction key!");
|
||||||
}
|
if (help_requested) goto retry;
|
||||||
if (!did_help) pline("What a strange direction!");
|
|
||||||
}
|
}
|
||||||
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user