]> granicus.if.org Git - nethack/commitdiff
creating nasty monsters on boulders
authorcohrs <cohrs>
Fri, 11 Oct 2002 15:59:14 +0000 (15:59 +0000)
committercohrs <cohrs>
Fri, 11 Oct 2002 15:59:14 +0000 (15:59 +0000)
<Someone> reported that a Titan summoning nasty monsters via a spell
resulted in various monsters being placed on locations containing boulders.
nasty() was using the summoning monster's type to decide where to place the
summoned monsters.  Note that this could theoretically also cause
inappropriate monsters to be placed in water, lava, walls, et al.
Rearranged the code to pick the monster type first.

doc/fixes34.1
src/wizard.c

index 47d1fbf8194d3347369325976bcbf842e607480b..cb654160383015b41321f5a05e2863977e5fec86 100644 (file)
@@ -271,7 +271,9 @@ class genocide that killed polymorphed self while `Unchanging' reported
 class genocide of @ by human or elf character polymorphed into non-@ gave
        "you feel dead inside" message twice
 unskilled rider who can't reach items on floor also can't dip into moat or
-               pool from flying steed
+       pool from flying steed
+when summoning nasty monsters, use new monster's type to decide if they can
+       be placed on boulders, et al, not the summoning monster's type
 
 
 Platform- and/or Interface-Specific Fixes
index a49d7a24798fe01b1c56ea20436d5b74150363a8..698eaa76ef8622f0c9c0412f8e7361b7ef74af13 100644 (file)
@@ -439,9 +439,6 @@ nasty(mcast)
            for(j=0; j<20; j++) {
                int makeindex;
 
-               if (mcast &&
-                       !enexto(&bypos, mcast->mux, mcast->muy, mcast->data))
-                   continue;
                /* Don't create more spellcasters of the monsters' level or
                 * higher--avoids chain summoners filling up the level.
                 */
@@ -449,6 +446,10 @@ nasty(mcast)
                    makeindex = pick_nasty();
                } while(mcast && attacktype(&mons[makeindex], AT_MAGC) &&
                        monstr[makeindex] >= monstr[mcast->mnum]);
+               /* do this after picking the monster to place */
+               if (mcast &&
+                   !enexto(&bypos, mcast->mux, mcast->muy, &mons[makeindex]))
+                   continue;
                if ((mtmp = makemon(&mons[makeindex],
                                    bypos.x, bypos.y, NO_MM_FLAGS)) != 0) {
                    mtmp->msleeping = mtmp->mpeaceful = mtmp->mtame = 0;