]> granicus.if.org Git - nethack/commitdiff
^G feedback
authorPatR <rankin@nethack.org>
Sun, 21 Feb 2021 01:15:58 +0000 (17:15 -0800)
committerPatR <rankin@nethack.org>
Sun, 21 Feb 2021 01:15:58 +0000 (17:15 -0800)
For ^G, if someone replies with empty input to the "Create which
monster?" prompt, give alternate feedback than "I've never heard
of such monsters." before reprompting.

src/read.c

index 51a4aae100cc570126db4002180df6f1b9423668..0f6bd5e05864f7938b352c0892673f5fda65f048 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 read.c  $NHDT-Date: 1610149501 2021/01/08 23:45:01 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.216 $ */
+/* NetHack 3.7 read.c  $NHDT-Date: 1613870144 2021/02/21 01:15:44 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.218 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -2665,7 +2665,7 @@ create_particular(void)
 #define CP_TRYLIM 5
     struct _create_particular_data d;
     char *bufp, buf[BUFSZ], prompt[QBUFSZ];
-    int  tryct = CP_TRYLIM;
+    int  tryct = CP_TRYLIM, altmsg = 0;
 
     buf[0] = '\0'; /* for EDIT_GETLIN */
     Strcpy(prompt, "Create what kind of monster?");
@@ -2679,7 +2679,12 @@ create_particular(void)
             break;
 
         /* no good; try again... */
-        pline("I've never heard of such monsters.");
+        if (*bufp || altmsg || tryct < 2) {
+            pline("I've never heard of such monsters.");
+        } else {
+            pline("Try again (type * for random, ESC to cancel).");
+            ++altmsg;
+        }
         /* when a second try is needed, expand the prompt */
         if (tryct == CP_TRYLIM)
             Strcat(prompt, " [type name or symbol]");