From: cohrs Date: Sat, 29 Jun 2002 17:05:18 +0000 (+0000) Subject: spellcasting level 0 monsters X-Git-Tag: MOVE2GIT~2717 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbc70f562a1605ba61629d15225368aca9c1ce19;p=nethack spellcasting level 0 monsters Based on a report from , 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. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 497c3eaa6..f7c48803a 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/mcastu.c b/src/mcastu.c index e1f2bffff..595b6a13f 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -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 {