player eating metal

1) player-as-rust monster should obey same rules for edible metal as monsters.
2) with GOLDOBJ, player-as-xorn couldn't eat gold in inventory
This commit is contained in:
cohrs
2002-02-12 03:53:05 +00:00
parent 54d0b2edfd
commit 924f3cbd37
2 changed files with 24 additions and 5 deletions

View File

@@ -763,8 +763,16 @@ register const char *let,*word;
ilet = 'a';
for (otmp = invent; otmp; otmp = otmp->nobj) {
if (!flags.invlet_constant) otmp->invlet = ilet; /* reassign() */
if (!*let || index(let, otmp->oclass)) {
if (!flags.invlet_constant)
#ifndef GOLDOBJ
if (otmp->invlet != GOLD_SYM) /* don't reassign this */
#endif
otmp->invlet = ilet; /* reassign() */
if (!*let || index(let, otmp->oclass)
#ifdef GOLDOBJ
|| (usegold && otmp->invlet == GOLD_SYM)
#endif
) {
register int otyp = otmp->otyp;
bp[foo++] = otmp->invlet;
@@ -995,7 +1003,11 @@ register const char *let,*word;
}
break;
}
if(!allowall && let && !index(let,otmp->oclass)) {
if(!allowall && let && !index(let,otmp->oclass)
#ifdef GOLDOBJ
&& !(usegold && otmp->oclass == GOLD_CLASS)
#endif
) {
pline(silly_thing_to, word);
return((struct obj *)0);
}