]> granicus.if.org Git - nethack/commitdiff
^G prompting revisited
authorPatR <rankin@nethack.org>
Wed, 30 Dec 2020 10:24:59 +0000 (02:24 -0800)
committerPatR <rankin@nethack.org>
Wed, 30 Dec 2020 10:24:59 +0000 (02:24 -0800)
CP_TRYLIM-1 was the right value when the prompt augmentation
was at the top of the loop before the first prompt, but should
been changed to CP_TRYLIM when that got moved to the bottom of
the loop.

First prompt:
|Create what kind of monster?
Second and subsequent prompts if first attempt is unsuccessful:
|Create what kind of monster? [type name or symbol]

Prior to this fix, the shorter prompt was being used on the
first and second tries and not switching to the longer one until
the third.

src/read.c

index 5d2c47bb3c4c38c0208c6b1be00dfb7201cac8bf..130259ee3d51600c4bcb9cc733610b9b8f7d2f8b 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 read.c  $NHDT-Date: 1609285441 2020/12/29 23:44:01 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.213 $ */
+/* NetHack 3.7 read.c  $NHDT-Date: 1609323865 2020/12/30 10:24:25 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.214 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -2709,7 +2709,7 @@ 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)
+        if (tryct == CP_TRYLIM)
             Strcat(prompt, " [type name or symbol]");
     } while (--tryct > 0);