]> granicus.if.org Git - nethack/commitdiff
^G prompting
authorPatR <rankin@nethack.org>
Tue, 29 Dec 2020 23:44:06 +0000 (15:44 -0800)
committerPatR <rankin@nethack.org>
Tue, 29 Dec 2020 23:44:06 +0000 (15:44 -0800)
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().

src/read.c

index fa790026fdcc91f9f56881cdc9e2f367f254a421..5d2c47bb3c4c38c0208c6b1be00dfb7201cac8bf 100644 (file)
@@ -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)