From: Pasi Kallinen Date: Sat, 5 Mar 2022 14:42:42 +0000 (+0200) Subject: Illiterate and blank spellbooks from gods X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dec6cad34eda3a0f8cd44ac67d67677e345960a;p=nethack Illiterate and blank spellbooks from gods Make gods avoid giving blank spellbooks as gifts, if you're illiterate. But if you do get a blank spellbook as a gift, don't force-learn that non-existent spell. --- diff --git a/src/pray.c b/src/pray.c index 44f0c6e50..b1bc82913 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1196,13 +1196,14 @@ pleased(aligntyp g_align) && !P_RESTRICTED(spell_skilltype(otmp->otyp))) break; /* usable, but not yet known */ } else { - if (!objects[SPE_BLANK_PAPER].oc_name_known - || carrying(MAGIC_MARKER)) + if ((!objects[SPE_BLANK_PAPER].oc_name_known + || carrying(MAGIC_MARKER)) && u.uconduct.literate) break; } otmp->otyp = rnd_class(g.bases[SPBOOK_CLASS], SPE_BLANK_PAPER); } - if (!u.uconduct.literate && !known_spell(otmp->otyp)) { + if (!u.uconduct.literate && (otmp->otyp != SPE_BLANK_PAPER) + && !known_spell(otmp->otyp)) { if (force_learn_spell(otmp->otyp)) pline("Divine knowledge of %s fills your mind!", OBJ_NAME(objects[otmp->otyp]));