From: cohrs Date: Tue, 19 Feb 2002 07:50:42 +0000 (+0000) Subject: touchstone: cannot rub on the stone gold X-Git-Tag: MOVE2GIT~3156 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b2aa68d24246c674afadd4e39499a4442cb6ce6;p=nethack touchstone: cannot rub on the stone gold hack around the silly grammar --- diff --git a/src/invent.c b/src/invent.c index 5c9c2c253..6d869d018 100644 --- a/src/invent.c +++ b/src/invent.c @@ -714,6 +714,7 @@ register const char *let,*word; boolean usegold = FALSE; /* can't use gold because its illegal */ boolean allowall = FALSE; boolean allownone = FALSE; + boolean touchstone = FALSE; xchar foox = 0; long cnt; boolean prezero = FALSE; @@ -727,14 +728,14 @@ register const char *let,*word; if(*let == GOLD_CLASS) let++, usegold = TRUE; #endif /* Ugly check for touchstone */ - if (!strncmp(word, "rub on", 6) + if (!strncmp(word, "rub on", 6)) { + touchstone = TRUE; /* avoid silly "stone gold" */ #ifndef GOLDOBJ - && u.ugold) - allowgold = usegold = TRUE; + if(u.ugold) allowgold = usegold = TRUE; #else - ) - usegold = TRUE; + usegold = TRUE; #endif + } /* Equivalent of an "ugly check" for gold */ if (usegold && !strcmp(word, "eat") && !metallivorous(youmonst.data)) @@ -917,9 +918,12 @@ register const char *let,*word; return(allownone ? &zeroobj : (struct obj *) 0); } if(ilet == def_oc_syms[GOLD_CLASS]) { - if(!usegold){ + if (!usegold) { + if (touchstone) + You("cannot rub gold on the stone."); + else You("cannot %s gold.", word); - return(struct obj *)0; + return(struct obj *)0; #ifndef GOLDOBJ } else if (!allowgold) { You("are not carrying any gold.");