-/* 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. */
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) {
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;
/* 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)