spellcasting level 0 monsters

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.
This commit is contained in:
cohrs
2002-06-29 17:05:18 +00:00
parent 60e26a84ae
commit cbc70f562a
2 changed files with 2 additions and 1 deletions
+1
View 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 an already wielded elven dagger "Sting" activates warning against orcs
naming either of the wielded weapons unintentionally ends two-weapon combat naming either of the wielded weapons unintentionally ends two-weapon combat
Various nemesis monsters must resist stoning so their death messages make sense 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 Platform- and/or Interface-Specific Fixes
+1 -1
View 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 casts spells only a small portion of the time that an
* attacking monster does. * 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; int cnt = 40;
do { do {