]> granicus.if.org Git - nethack/commitdiff
fix #H4047 - dipping inconsistency
authorPatR <rankin@nethack.org>
Sun, 13 Dec 2015 03:41:35 +0000 (19:41 -0800)
committerPatR <rankin@nethack.org>
Sun, 13 Dec 2015 03:41:35 +0000 (19:41 -0800)
Dip the scroll labeled LEP GEX VEN ZEA into the fountain?
Your scroll called light fades.

The first prompt deliberately avoided 'called', 'named', and other
attributes to keep it short, but the discrepancy here is blatant, so
increase the verbosity in order to have the reminder that's included
in the prompt be the same as object name in the followup message.

Bonus fix, noticed while testing it:  water_damage() was reporting
the "{blank,unlabeled} scroll fades" even though blank scrolls are
already as faded as they can get.  Likewise for blank spellbook.

doc/fixes36.1
src/potion.c
src/trap.c

index 7558e464856187c21f8016f4d46336d2d9355339..f673d44a92aadecd23215db8171adf562f850220 100644 (file)
@@ -19,6 +19,9 @@ unlike in previous versions, an uncursed scroll of enchant armor failed to
        uncurse the piece of armor being enchanted (change was unintentional)
 slice of {pizza,cake,&} pluralized as "slouse of ..." due to false match
        with "lice" (discovered pre-3.6.0-release)
+change dipping prompt to not ignore 'called' and 'named' attributes of item
+       to be dipped
+avoid 'the unlabeled {scroll,spellbook} fades' when blank item is hit by water
 
 
 Platform- and/or Interface-Specific Fixes
index 7484d29d2eb8379845a417892906d275a75e201a..566eb7bfc07dadfadae9f0c5cca9a4aeb8f49531 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 potion.c        $NHDT-Date: 1446861768 2015/11/07 02:02:48 $  $NHDT-Branch: master $:$NHDT-Revision: 1.121 $ */
+/* NetHack 3.6 potion.c        $NHDT-Date: 1449977945 2015/12/13 03:39:05 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.122 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1759,6 +1759,7 @@ dodip()
     char allowall[2];
     short mixture;
     char qbuf[QBUFSZ], qtoo[QBUFSZ];
+    const char *shortestname; /* last resort obj name for prompt */
 
     allowall[0] = ALL_CLASSES;
     allowall[1] = '\0';
@@ -1767,13 +1768,13 @@ dodip()
     if (inaccessible_equipment(obj, "dip", FALSE))
         return 0;
 
-    Sprintf(qbuf, "dip %s into", thesimpleoname(obj));
+    shortestname = is_plural(obj) ? "them" : "it";
     here = levl[u.ux][u.uy].typ;
     /* Is there a fountain to dip into here? */
     if (IS_FOUNTAIN(here)) {
         /* "Dip <the object> into the fountain?" */
-        Sprintf(qtoo, "%s the fountain?", qbuf);
-        if (yn(upstart(qtoo)) == 'y') {
+        if (yn(safe_qbuf(qbuf, "Dip ", " into the fountain?", obj,
+                         doname, thesimpleoname, shortestname)) == 'y') {
             dipfountain(obj);
             return 1;
         }
@@ -1781,8 +1782,9 @@ dodip()
         const char *pooltype = waterbody_name(u.ux, u.uy);
 
         /* "Dip <the object> into the {pool, moat, &c}?" */
-        Sprintf(qtoo, "%s the %s?", qbuf, pooltype);
-        if (yn(upstart(qtoo)) == 'y') {
+        Sprintf(qtoo, " into the %s?", pooltype);
+        if (yn(safe_qbuf(qbuf, "Dip ", qtoo, obj,
+                         doname, thesimpleoname, shortestname)) == 'y') {
             if (Levitation) {
                 floating_above(pooltype);
             } else if (u.usteed && !is_swimmer(u.usteed->data)
@@ -1799,6 +1801,9 @@ dodip()
     }
 
     /* "What do you want to dip <the object> into?" */
+    Strcpy(qbuf, safe_qbuf(qtoo, "What do you want to dip ", " into?", obj,
+                           doname, thesimpleoname, shortestname)
+                 + sizeof "What do you want to " - sizeof "");
     potion = getobj(beverages, qbuf); /* "dip into" */
     if (!potion)
         return 0;
index b8944eea9670424fadbcbfab64da83fe54eaf17e..747f626e6bf8083bf41bb3b576f93d8a6f1a23ca 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 trap.c  $NHDT-Date: 1448492213 2015/11/25 22:56:53 $  $NHDT-Branch: master $:$NHDT-Revision: 1.249 $ */
+/* NetHack 3.6 trap.c  $NHDT-Date: 1449977947 2015/12/13 03:39:07 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.250 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -3345,10 +3345,11 @@ boolean force;
             */
         return ER_NOTHING;
     } else if (obj->oclass == SCROLL_CLASS) {
+        if (obj->otyp == SCR_BLANK_PAPER
 #ifdef MAIL
-        if (obj->otyp == SCR_MAIL)
-            return 0;
+            || obj->otyp == SCR_MAIL
 #endif
+           ) return 0;
         if (carried(obj))
             pline("Your %s %s.", ostr, vtense(ostr, "fade"));
 
@@ -3362,8 +3363,9 @@ boolean force;
         if (obj->otyp == SPE_BOOK_OF_THE_DEAD) {
             pline("Steam rises from %s.", the(xname(obj)));
             return 0;
+        } else if (obj->otyp == SPE_BLANK_PAPER) {
+            return 0;
         }
-
         if (carried(obj))
             pline("Your %s %s.", ostr, vtense(ostr, "fade"));