From: nethack.rankin Date: Sat, 14 Sep 2002 13:00:20 +0000 (+0000) Subject: treasure detection X-Git-Tag: MOVE2GIT~2422 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba8d740500f65e81d273e475915f188120b33df6;p=nethack treasure detection Expert and skilled detect treasure was changed to behave like blessed object detection in 3.3.1, but it didn't work as intended. > Subject: [patch] skilled detect treasure doesn't detect object types > > Date: 13 Sep 2002 09:58:41 -0400 > > > It looks like the detect treasure spell when cast with skilled or expert > ability in divination is supposed to detect the type of an object ("a > scroll of identify" rather than "a scroll"), but this doesn't actually > work in 3.4.0. Here is a fix. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index d86b57b79..f2315110f 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -245,6 +245,8 @@ elevate the trouble priority of any cursed item which is preventing removal starving pets will eat more aggressively when a pet starves to death, say so instead of just "Fido dies." starved pet raised from dead shouldn't immediately starve again +skilled spell of detected treasure wasn't acting like blessed potion of + object detection (from Roderick Schertler) Platform- and/or Interface-Specific Fixes diff --git a/src/detect.c b/src/detect.c index 325d8c59b..ae30ecb8f 100644 --- a/src/detect.c +++ b/src/detect.c @@ -391,7 +391,7 @@ register struct obj *sobj; } /* - * Used for scrolls, potions, and crystal balls. Returns: + * Used for scrolls, potions, spells, and crystal balls. Returns: * * 1 - nothing was detected * 0 - something was detected @@ -403,8 +403,9 @@ int class; /* an object class, 0 for all */ { register int x, y; int is_cursed = (detector && detector->cursed); - int do_dknown = - (detector && detector->oclass == POTION_CLASS && detector->blessed); + int do_dknown = (detector && (detector->oclass == POTION_CLASS || + detector->oclass == SPBOOK_CLASS) && + detector->blessed); int ct = 0, ctu = 0; register struct obj *obj, *otmp = (struct obj *)0; register struct monst *mtmp;