From: PatR Date: Tue, 14 Jun 2016 23:43:03 +0000 (-0700) Subject: eating off floor while blind X-Git-Tag: NetHack-3.6.1_RC01~674 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e257dc7e8cbc1f8c821d170b611650662b963fa;p=nethack eating off floor while blind Reported directly to devteam in late December, when blind and lacking gloves, you could safely locate cockatrice corpses on the floor by using 'm' prefix to move without pickup followed by 'e' and then answering no when ask whether to eat a cockatrice corpse. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index b6001058c..ef4ec400c 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -292,6 +292,8 @@ at startup, if sysconf had been read but user's own config file couldn't be read, sysconf got processed again as if it contained user's options don't give "you cannot pass through the bars" when travel is testing possible paths in the vicinity of iron bars +if blind and no gloves, using 'm' to move and then 'e' could be used to + locate cockatrice corpse without fatal touching (by declining to eat) Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository diff --git a/src/eat.c b/src/eat.c index 5aaac8720..59a33053f 100644 --- a/src/eat.c +++ b/src/eat.c @@ -3009,6 +3009,16 @@ int corpsecheck; /* 0, no check, 1, corpses, 2, tinnable corpses */ char qsfx[QBUFSZ]; boolean one = (otmp->quan == 1L); + /* if blind and without gloves, attempting to eat (or tin or + offer) a cockatrice corpse is fatal before asking whether + or not to use it; otherwise, 'm' followed by 'e' could + be used to locate cockatrice corpses without touching them */ + if (otmp->otyp == CORPSE && will_feel_cockatrice(otmp, FALSE)) { + feel_cockatrice(otmp, FALSE); + /* if life-saved (or poly'd into stone golem), terminate + attempt to eat off floor */ + return (struct obj *) 0; + } /* "There is here; it?" or "There are here; one?" */ Sprintf(qbuf, "There %s ", otense(otmp, "are")); @@ -3026,8 +3036,8 @@ skipfloor: /* We cannot use ALL_CLASSES since that causes getobj() to skip its * "ugly checks" and we need to check for inedible items. */ - otmp = - getobj(feeding ? allobj : offering ? offerfodder : comestibles, verb); + otmp = getobj(feeding ? allobj : offering ? offerfodder : comestibles, + verb); if (corpsecheck && otmp && !(offering && otmp->oclass == AMULET_CLASS)) if (otmp->otyp != CORPSE || (corpsecheck == 2 && !tinnable(otmp))) { You_cant("%s that!", verb);