]> granicus.if.org Git - nethack/commitdiff
spellcasting level 0 monsters
authorcohrs <cohrs>
Sat, 29 Jun 2002 17:05:18 +0000 (17:05 +0000)
committercohrs <cohrs>
Sat, 29 Jun 2002 17:05:18 +0000 (17:05 +0000)
Based on a report from <Someone>, avoid calling rn2(ml) when ml == 0.
Since level 0 monster always fail in their spells, just skip the whole
loop looking for a good spell.

doc/fixes34.1
src/mcastu.c

index 497c3eaa6d64e25c89f5cdec3ec6abf7eb04831f..f7c48803a38337525af38cc61016c64239492833 100644 (file)
@@ -125,6 +125,7 @@ prevent getting stuck in infinite loop when using wizard mode #levelchange
 naming an already wielded elven dagger "Sting" activates warning against orcs
 naming either of the wielded weapons unintentionally ends two-weapon combat
 Various nemesis monsters must resist stoning so their death messages make sense
+don't call DEBUG impossible in rn2 when a level 0 monster tries to cast a spell
 
 
 Platform- and/or Interface-Specific Fixes
index e1f2bffff5a7ffd710d5d9598be6912d376e922f..595b6a13f0e1e823afd5b978d958d28d6e015583 100644 (file)
@@ -181,7 +181,7 @@ castmu(mtmp, mattk, thinks_it_foundyou, foundyou)
         * attacking casts spells only a small portion of the time that an
         * attacking monster does.
         */
-       if (mattk->adtyp == AD_SPEL || mattk->adtyp == AD_CLRC) {
+       if ((mattk->adtyp == AD_SPEL || mattk->adtyp == AD_CLRC) && ml) {
            int cnt = 40;
 
            do {