Newsgroups: rec.games.roguelike.nethack
Cc: nethack-bugs@nethack.org
Subject: [patch] skilled detect treasure doesn't detect object types
From: Roderick Schertler <roderick@argon.org>
Date: 13 Sep 2002 09:58:41 -0400
Message-ID: <pzadmmj8j2.fsf@eeyore.ibcinc.com>
Lines: 23
X-Newsreader: Gnus v5.7/Emacs 20.7

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.

--- src/detect.c.~1~	2002-03-20 18:43:01.000000000 -0500
+++ src/detect.c	2002-09-13 09:49:51.000000000 -0400
@@ -403,8 +403,9 @@
 {
     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;

-- 
Roderick Schertler
roderick@argon.org
