From: PatR Date: Sun, 21 Feb 2021 01:15:58 +0000 (-0800) Subject: ^G feedback X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9ed4407de92548362b2c4315309c37f14453967;p=nethack ^G feedback 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. --- diff --git a/src/read.c b/src/read.c index 51a4aae10..0f6bd5e05 100644 --- a/src/read.c +++ b/src/read.c @@ -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]");