]> granicus.if.org Git - nethack/commitdiff
Fix wishing for tins of specific type
authorPasi Kallinen <paxed@alt.org>
Wed, 14 Dec 2016 16:27:57 +0000 (18:27 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 14 Dec 2016 16:28:01 +0000 (18:28 +0200)
I believe this bug already existed, but was only exposed by
my wishing parser change post-3.6.0

src/objnam.c

index 7a800d23a7599ea6eb7d1191c7889a127d9b5ffa..af3cc25118e637af52d59a73481e5b16458f4999 100644 (file)
@@ -2839,11 +2839,12 @@ struct obj *no_wish;
          */
         if (!strstri(bp, "wand ") && !strstri(bp, "spellbook ")
             && !strstri(bp, "finger ")) {
-            if (((p = strstri(bp, "tin of ")) != 0)
-                && (tmp = tin_variety_txt(p + 7, &tinv))
-                && (mntmp = name_to_mon(p + 7 + tmp)) >= LOW_PM) {
-                *(p + 3) = 0;
+            if ((p = strstri(bp, "tin of ")) != 0) {
+                tmp = tin_variety_txt(p + 7, &tinv);
                 tvariety = tinv;
+                mntmp = name_to_mon(p + 7 + tmp);
+                typ = TIN;
+                goto typfnd;
             } else if ((p = strstri(bp, " of ")) != 0
                        && (mntmp = name_to_mon(p + 4)) >= LOW_PM)
                 *p = 0;