fix #H4078 - dull spellbook vs sleep resistance

Reading a dull spellbook could make a sleep resistant hero fall asleep.
This commit is contained in:
PatR
2015-12-14 13:27:31 -08:00
parent f5b5a428c1
commit c843f56897
2 changed files with 3 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ negative intrinsic protection shouldn't confer MC=1, "you are warded" (not
possible from divine protection but is possible from eating rings)
make a slight adjustment to the quickmimic() sense wording
fix typo in passage 1 of The Colour of Magic
falling asleep when reading dull spellbook ignored sleep resistance
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 spell.c $NHDT-Date: 1447653429 2015/11/16 05:57:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */
/* NetHack 3.6 spell.c $NHDT-Date: 1450128440 2015/12/14 21:27:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.73 $ */
/* Copyright (c) M. Stephenson 1988 */
/* NetHack may be freely redistributed. See license for details. */
@@ -430,7 +430,7 @@ register struct obj *spellbook;
boolean too_hard = FALSE;
/* attempting to read dull book may make hero fall asleep */
if (!confused && booktype != SPE_BLANK_PAPER
if (!confused && !Sleep_resistance
&& !strcmp(OBJ_DESCR(objects[booktype]), "dull")) {
const char *eyes;
int dullbook = rnd(25) - ACURR(A_WIS);