]> granicus.if.org Git - nethack/commitdiff
treasure detection
authornethack.rankin <nethack.rankin>
Sat, 14 Sep 2002 13:00:20 +0000 (13:00 +0000)
committernethack.rankin <nethack.rankin>
Sat, 14 Sep 2002 13:00:20 +0000 (13:00 +0000)
     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
> <email deleted>
> Date: 13 Sep 2002 09:58:41 -0400
> <email deleted>
>
> 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.

doc/fixes34.1
src/detect.c

index d86b57b79bb619f6b3eda0a911fbf3d1daa42843..f2315110f848d5a71f107048be2b6d66d5079801 100644 (file)
@@ -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
index 325d8c59bb0ba09dc85f2e1b8ebb5484ace424e2..ae30ecb8f472242f117e074cc38a067e8fc6f3f4 100644 (file)
@@ -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;