From: Pasi Kallinen Date: Wed, 14 Dec 2016 16:27:57 +0000 (+0200) Subject: Fix wishing for tins of specific type X-Git-Tag: NetHack-3.6.1_RC01~542 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4632732ac9422ebd70e05c29d276513d949dcfb;p=nethack Fix wishing for tins of specific type I believe this bug already existed, but was only exposed by my wishing parser change post-3.6.0 --- diff --git a/src/objnam.c b/src/objnam.c index 7a800d23a..af3cc2511 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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;