]> granicus.if.org Git - nethack/commitdiff
<Someone>'s potion of polymorph suggestion
authornethack.allison <nethack.allison>
Wed, 6 Mar 2002 00:22:37 +0000 (00:22 +0000)
committernethack.allison <nethack.allison>
Wed, 6 Mar 2002 00:22:37 +0000 (00:22 +0000)
> Should a potion of polymorph autoidentify if the item dipped into it
> polymorphs into (as far as you know) the same item? It just seemed
> odd, choosing "Z - a wand of light" to dip into a potion, to get
> "Z - a wand of light" returned, and the potion identified.
>
> (Ideally, I'd like to see it be "Nothing seems to happen.", as for
> a failed-this-time unicorn horn.)

src/potion.c

index e035954e85222e38d0800382cd28db230fc4e3fe..f82c390c578bb966816d24080f63f2357b2a1f4e 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)potion.c   3.4     2002/02/07      */
+/*     SCCS Id: @(#)potion.c   3.4     2002/03/05      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1606,6 +1606,7 @@ dodip()
                pline(nothing_happens);
            } else {
                boolean was_wep = FALSE, was_swapwep = FALSE, was_quiver = FALSE;
+               short save_otyp = obj->otyp;
                /* KMH, conduct */
                u.uconduct.polypiles++;
 
@@ -1619,9 +1620,14 @@ dodip()
                else if (was_swapwep) setuswapwep(obj);
                else if (was_quiver) setuqwep(obj);
 
-               makeknown(POT_POLYMORPH);
-               useup(potion);
-               prinv((char *)0, obj, 0L);
+               if (obj->otyp != save_otyp) {
+                       makeknown(POT_POLYMORPH);
+                       useup(potion);
+                       prinv((char *)0, obj, 0L);
+               } else {
+                       pline("Nothing seems to happen.");
+                       useup(potion);
+               }
            }
            return(1);
        } else if(obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) {