From: cohrs Date: Fri, 25 Jan 2002 08:08:33 +0000 (+0000) Subject: inappropriate very difficult reading message X-Git-Tag: MOVE2GIT~3349 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82611f9cd8abf8754b5e20ea6667b41a2bf44e99;p=nethack inappropriate very difficult reading message add missing set of parentheses around lense test in read_ability calculation --- diff --git a/src/spell.c b/src/spell.c index 0d3fec3b8..0ff8cfb03 100644 --- a/src/spell.c +++ b/src/spell.c @@ -382,30 +382,31 @@ register struct obj *spellbook; /* Books are often wiser than their readers (Rus.) */ spellbook->in_use = TRUE; - if (!spellbook->blessed && spellbook->otyp != SPE_BOOK_OF_THE_DEAD) { - if (spellbook->cursed) { - too_hard = TRUE; - } else { - /* uncursed - chance to fail */ - int read_ability = ACURR(A_INT) + 4 + u.ulevel/2 - - 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) { - char qbuf[QBUFSZ]; - Sprintf(qbuf, + if (!spellbook->blessed && + spellbook->otyp != SPE_BOOK_OF_THE_DEAD) { + if (spellbook->cursed) { + too_hard = TRUE; + } else { + /* uncursed - chance to fail */ + int read_ability = ACURR(A_INT) + 4 + u.ulevel/2 + - 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) { + char qbuf[QBUFSZ]; + Sprintf(qbuf, "This spellbook is %sdifficult to comprehend. Continue?", - (read_ability < 12 ? "very " : "")); - if (yn(qbuf) != 'y') { - spellbook->in_use = FALSE; - return(1); - } - } - /* its up to random luck now */ - if (rnd(20) > read_ability) { - too_hard = TRUE; + (read_ability < 12 ? "very " : "")); + if (yn(qbuf) != 'y') { + spellbook->in_use = FALSE; + return(1); } } + /* its up to random luck now */ + if (rnd(20) > read_ability) { + too_hard = TRUE; + } + } } if (too_hard) {