]> granicus.if.org Git - nethack/commitdiff
Move check for starting L1 spellbook to include non-random spellbooks
authorMatthew Everett <meverett@Matthews-MacBook-Pro.local>
Sun, 22 May 2022 04:09:28 +0000 (21:09 -0700)
committerPatR <rankin@nethack.org>
Sat, 11 Jun 2022 22:29:37 +0000 (15:29 -0700)
src/u_init.c

index ce3090dd6c48bb6e062b43a2983a5324b3847cea..19e9783a6eadb7026e2b5792c2e7c8c4ee29bcd9 100644 (file)
@@ -1082,9 +1082,6 @@ ini_inv(struct trobj *trop)
             /* Don't have 2 of the same ring or spellbook */
             if (obj->oclass == RING_CLASS || obj->oclass == SPBOOK_CLASS)
                 g.nocreate4 = otyp;
-            /* First spellbook should be level 1 - did we get it? */
-            if (obj->oclass == SPBOOK_CLASS && objects[obj->otyp].oc_level == 1)
-                got_sp1 = TRUE;
         }
 
         if (g.urace.mnum != PM_HUMAN) {
@@ -1183,6 +1180,10 @@ ini_inv(struct trobj *trop)
         if (obj->oclass == SPBOOK_CLASS && obj->otyp != SPE_BLANK_PAPER)
             initialspell(obj);
 
+        /* First spellbook should be level 1 - did we get it? */
+        if (obj->oclass == SPBOOK_CLASS && objects[obj->otyp].oc_level == 1)
+            got_sp1 = TRUE;
+
         if (--trop->trquan)
             continue; /* make a similar object */
         trop++;