From e5148d5d578ea10750fad89169ede55b31b0d343 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Wed, 7 Aug 2002 08:04:27 +0000 Subject: [PATCH] wishing fixes for "* glass" The wishing code intended to make a wish for "blue glass" yield a "worthless piece of blue glass" (and similarly for other specific colors) but it didn't work right. Also, wishing for "looking glass" tripped up on that same code and didn't work either. (Several other permutations for worthless gems such as "worthless blue glass" and "piece of glass" already do work.) --- doc/fixes34.1 | 1 + src/objnam.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 46583ce52..a112e16ce 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -189,6 +189,7 @@ prevent crash after animating a statue via stone to flesh by avoiding use of the obj in newsym() after it was deleted print "magic spreads" message when eating ring of increase damage, etc. grammar tid: "The looking glass miss the ." +fix wishing for "looking glass" and " glass" Platform- and/or Interface-Specific Fixes diff --git a/src/objnam.c b/src/objnam.c index 5c843669d..58b3e30af 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2040,6 +2040,8 @@ boolean from_user; oclass = GEM_CLASS; dn = actualn = bp; goto srch; + } else if (!strcmpi(bp, "looking glass")) { + ; /* avoid false hit on "* glass" */ } else if (!BSTRCMPI(bp, p-6, " glass") || !strcmpi(bp, "glass")) { register char *g = bp; if (strstri(g, "broken")) return (struct obj *)0; @@ -2052,7 +2054,7 @@ boolean from_user; typ = LAST_GEM + rnd(9); if (objects[typ].oc_class == GEM_CLASS) goto typfnd; else typ = 0; /* somebody changed objects[]? punt */ - } else if (g > bp) { /* try to construct canonical form */ + } else { /* try to construct canonical form */ char tbuf[BUFSZ]; Strcpy(tbuf, "worthless piece of "); Strcat(tbuf, g); /* assume it starts with the color */