From: PatR Date: Tue, 29 Dec 2020 23:44:06 +0000 (-0800) Subject: ^G prompting X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b735122c2ccb8a704d838c689bb08e65d2b42894;p=nethack ^G prompting Make the initial prompt for ^G be less verbose. Only expand to the verbose form if a second or further try is needed. Also, remove an orphan comment about is_male() and is_female(). --- diff --git a/src/read.c b/src/read.c index fa790026f..5d2c47bb3 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 read.c $NHDT-Date: 1608846072 2020/12/24 21:41:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.207 $ */ +/* NetHack 3.7 read.c $NHDT-Date: 1609285441 2020/12/29 23:44:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.213 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2625,7 +2625,6 @@ struct _create_particular_data *d; continue; } mx = mtmp->mx, my = mtmp->my; - /* 'is_FOO()' ought to be called 'always_FOO()' */ if (d->maketame) { (void) tamedog(mtmp, (struct obj *) 0); } else if (d->makepeaceful || d->makehostile) { @@ -2691,12 +2690,15 @@ struct _create_particular_data *d; boolean create_particular() { - char buf[BUFSZ] = DUMMY, *bufp; - int tryct = 5; +#define CP_TRYLIM 5 struct _create_particular_data d; + char *bufp, buf[BUFSZ], prompt[QBUFSZ]; + int tryct = CP_TRYLIM; + buf[0] = '\0'; /* for EDIT_GETLIN */ + Strcpy(prompt, "Create what kind of monster?"); do { - getlin("Create what kind of monster? [type the name or symbol]", buf); + getlin(prompt, buf); bufp = mungspaces(buf); if (*bufp == '\033') return FALSE; @@ -2706,6 +2708,9 @@ create_particular() /* no good; try again... */ pline("I've never heard of such monsters."); + /* when a second try is needed, expand the prompt */ + if (tryct == CP_TRYLIM - 1) + Strcat(prompt, " [type name or symbol]"); } while (--tryct > 0); if (!tryct)