]> granicus.if.org Git - nethack/commitdiff
tearing spellbooks while confused
authorcohrs <cohrs>
Wed, 21 Aug 2002 16:43:48 +0000 (16:43 +0000)
committercohrs <cohrs>
Wed, 21 Aug 2002 16:43:48 +0000 (16:43 +0000)
Reported to the newsgroup, the code in study_book for the effect of
confusion on studying a book was never reached.  The study_book code
didn't completely handle continuing to read a book when you got confused
after getting interrupted.

src/spell.c

index c30cc75bcabd0cd6f971c8f69c143272764681e3..baa5b5abcafbc9ae1feb557e27d05001c22ae83d 100644 (file)
@@ -350,7 +350,7 @@ register struct obj *spellbook;
        register boolean confused = (Confusion != 0);
        boolean too_hard = FALSE;
 
-       if (delay && spellbook == book &&
+       if (delay && !confused && spellbook == book &&
                    /* handle the sequence: start reading, get interrupted,
                       have book become erased somehow, resume reading it */
                    booktype != SPE_BLANK_PAPER) {
@@ -398,7 +398,8 @@ register struct obj *spellbook;
                            - 2*objects[booktype].oc_level
                            + ((ublindf && ublindf->otyp == LENSES) ? 2 : 0);
                        /* only wizards know if a spell is too difficult */
-                       if (Role_if(PM_WIZARD) && read_ability < 20) {
+                       if (Role_if(PM_WIZARD) && read_ability < 20 &&
+                           !confused) {
                            char qbuf[QBUFSZ];
                            Sprintf(qbuf,
                      "This spellbook is %sdifficult to comprehend. Continue?",