From 6fea907683f212669e15ea533de5648f588941fe Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Mon, 28 Jan 2002 12:58:45 +0000 Subject: [PATCH] disclose refinements: - allow spaces between the different possibilities - add a missing null at the end of the list of prefixes to prevent index() from going crazy - slight re-wording of the Guidebook --- doc/Guidebook.mn | 13 +++++++------ doc/Guidebook.tex | 13 +++++++------ src/options.c | 8 ++++++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index e1c86b5ff..506102eed 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1653,13 +1653,13 @@ The possibilities are: .si i - disclose your inventory. a - disclose your attributes. -v - summarizing monsters that have been vanquished. -g - listing monster species that have been genocided. -c - displaying your conduct. +v - summarize monsters that have been vanquished. +g - list monster species that have been genocided. +c - display your conduct. .ei .ed Each disclosure possibility can optionally be preceded by a prefix which -let you refine how it behaves. Here are some of the prefixes: +let you refine how it behaves. Here are the valid prefixes: .sd .si y - prompt you and default to yes on the prompt. @@ -1668,8 +1668,7 @@ n - prompt you and default to no on the prompt. - - do not disclose it and do not prompt. .ei .ed -Note that the vanquished monsters list includes all monsters killed by -traps and each other as well as by you.(ex. ``disclose:yina+v-g-c'') +(ex. ``disclose:yi na +v -g -c'') The example sets .op inventory to prompt and default to yes, @@ -1681,6 +1680,8 @@ to disclose without prompting, to not disclose and not to prompt, .op conduct to not disclose and not to prompt. +Note that the vanquished monsters list includes all monsters killed by +traps and each other as well as by you. .lp dogname Name your starting dog (ex. ``dogname:Fang''). Cannot be set with the `O' command. diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 07ce8a637..e8d2378b7 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2075,14 +2075,14 @@ The possibilities are: %.si {\tt i} --- disclose your inventory.\\ {\tt a} --- disclose your attributes.\\ -{\tt v} --- summarizing monsters that have been vanquished.\\ -{\tt g} --- listing monster species that have been genocided.\\ -{\tt c} --- displaying your conduct. +{\tt v} --- summarize monsters that have been vanquished.\\ +{\tt g} --- list monster species that have been genocided.\\ +{\tt c} --- display your conduct. %.ei %.ed Each disclosure possibility can optionally be preceded by a prefix which -let you refine how it behaves. Here are some of the prefixes: +let you refine how it behaves. Here are the valid prefixes: %.sd %.si @@ -2093,13 +2093,14 @@ let you refine how it behaves. Here are some of the prefixes: %.ei %.ed -Note that the vanquished monsters list includes all monsters killed by -traps and each other as well as by you. (ex.\ ``{\tt disclose:yina+v-g-c}'') +(ex.\ ``{\tt disclose:yi na +v -g -c}'') The example sets {\it inventory\/} to {\it prompt\/} and default to {\it yes\/}, {\it attributes\/} to {\it prompt\/} and default to {\it no\/}, {\it vanquished\/} to {\it disclose without prompting\/}, {\it genocided\/} to {\it not disclose\/} and not to {\it prompt\/}, and {\it conduct\/} to {\it not disclose\/} and not to {\it prompt\/}. +Note that the vanquished monsters list includes all monsters killed by +traps and each other as well as by you. %.lp \item[\ib{dogname}] Name your starting dog (ex.\ ``{\tt dogname:Fang}''). diff --git a/src/options.c b/src/options.c index 1d0e7952c..5300540b5 100644 --- a/src/options.c +++ b/src/options.c @@ -1555,7 +1555,7 @@ goodfruit: } /* things to disclose at end of game */ - if (match_optname(opts, "disclose", 4, TRUE)) { + if (match_optname(opts, "disclose", 7, TRUE)) { /* * The order that the end_disclore options are stored: * inventory, attribs, vanquished, genocided, conduct @@ -1604,7 +1604,8 @@ goodfruit: DISCLOSE_PROMPT_DEFAULT_YES, DISCLOSE_PROMPT_DEFAULT_NO, DISCLOSE_YES_WITHOUT_PROMPT, - DISCLOSE_NO_WITHOUT_PROMPT + DISCLOSE_NO_WITHOUT_PROMPT, + '\0' }; c = lowc(*op); if (c == 'k') c = 'v'; /* killed -> vanquished */ @@ -1623,6 +1624,8 @@ goodfruit: flags.end_disclose[idx] = DISCLOSE_YES_WITHOUT_PROMPT; } else if (index(valid_settings, c)) { prefix_val = c; + } else if (c == ' ') { + /* do nothing */ } else badopt = TRUE; op++; @@ -2402,6 +2405,7 @@ char *buf; else if (!strcmp(optname, "disclose")) { for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) { char topt[2]; + if (i) Strcat(buf," "); topt[1] = '\0'; topt[0] = flags.end_disclose[i]; Strcat(buf, topt);