]> granicus.if.org Git - nethack/commitdiff
fix B20003 - hallucination and warning
authornethack.rankin <nethack.rankin>
Thu, 20 Feb 2003 00:19:49 +0000 (00:19 +0000)
committernethack.rankin <nethack.rankin>
Thu, 20 Feb 2003 00:19:49 +0000 (00:19 +0000)
> Why does warning work normally while hallucinating?  I'd like to see
> random numbers.

     It's just a one-liner, although it has pointed out problems in the
symbol lookup code.  "0" won't work at present, so this doesn't use it,
but warning symbols "1" through "5" also have trouble--regardless of
hallucination--if someone overloads them to represent any feature aside
from warning.

doc/fixes34.1
src/display.c

index e9437ad5c2c2837a96ab9fa2c6015048824162bf..d69aeae5388756df0693aa316a14366ebf81f154 100644 (file)
@@ -395,6 +395,7 @@ any object held by ghost during recorporealization would cease to exist
        including the Amulet of Yendor
 harassing monsters will be less likely to teleport to your location while
        they're running away from you
+randomize warning symbols during hallucination
 
 
 Platform- and/or Interface-Specific Fixes
index c5138f2379ca60ba478b0133152d0646dc3e9776..d23559021e42a0607c859ce8d152050586490d6a 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)display.c  3.4     2002/10/03      */
+/*     SCCS Id: @(#)display.c  3.4     2003/02/19      */
 /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
 /* and Dave Cohrs, 1990.                                         */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -460,6 +460,9 @@ display_warning(mon)
 
     if (mon_warning(mon)) {
         if (wl > WARNCOUNT - 1) wl = WARNCOUNT - 1;
+       /* 3.4.1: this really ought to be rn2(WARNCOUNT), but value "0"
+          isn't handled correctly by the what_is routine so avoid it */
+       if (Hallucination) wl = rn1(WARNCOUNT-1,1);
         glyph = warning_to_glyph(wl);
     } else if (MATCH_WARN_OF_MON(mon)) {
        glyph = mon_to_glyph(mon);