]> granicus.if.org Git - nethack/commitdiff
add MM_NOGRP makemon() flag
authornhmall <nhmall@nethack.org>
Fri, 7 Dec 2018 14:29:01 +0000 (09:29 -0500)
committernhmall <nhmall@nethack.org>
Fri, 7 Dec 2018 14:29:01 +0000 (09:29 -0500)
add MM_NOGRP makemon() flag as a means of suppressing groups of monsters in
a couple places that warrant it when a specific monster type isn't
specified on the call to makemon()

doc/fixes36.2
include/hack.h
src/makemon.c
src/mklev.c

index 421792d3869949fd9b331d5c7f3656a423aaf863..538c632cace43aaf5a16483ba15aad12545281fd 100644 (file)
@@ -252,6 +252,9 @@ hero hit by something that causes inventory items to be destroyed with loss of
        similar problem with more obvious symptom, an "object lost" panic when
        the unholy water was wielded; the fix for that wasn't general enough]
 add MM_ASLEEP makemon() flag and honor it when creating group for fill_zoo
+add MM_NOGRP makemon() flag as a means of suppressing groups of monsters in
+       a couple places that warrant it when a specific monster type isn't
+       specified on the call to makemon()
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index beab7da8a97931ae17d47d519e148edc8b90c9f5..e59693d5f02aff9533a4adb796195c676026fbbe 100644 (file)
@@ -261,6 +261,7 @@ typedef struct sortloot_item Loot;
 #define MM_EMIN   0x00800   /* add emin structure */
 #define MM_EDOG   0x01000   /* add edog structure */
 #define MM_ASLEEP 0x02000   /* monsters should be generated asleep */
+#define MM_NOGRP  0x04000   /* suppress creation of monster groups */
 
 /* flags for make_corpse() and mkcorpstat() */
 #define CORPSTAT_NONE 0x00
index e4d799e9b3e2bd33b6f54681aef27a998d5ed8d8..20912b8da2645cafb9137aa55aafaa9da894cf2a 100644 (file)
@@ -129,10 +129,8 @@ int x, y, n, mmflags;
          * smaller group.
          */
         if (enexto(&mm, mm.x, mm.y, mtmp->data)) {
-            mon = makemon(mtmp->data, mm.x, mm.y, NO_MM_FLAGS);
+            mon = makemon(mtmp->data, mm.x, mm.y, (mmflags | MM_NOGRP));
             if (mon) {
-                if (mmflags & MM_ASLEEP)
-                    mon->msleeping = 1;
                 mon->mpeaceful = FALSE;
                 mon->mavenge = 0;
                 set_malign(mon);
@@ -1367,7 +1365,7 @@ int mmflags;
                               : eminp->renegade;
     }
     set_malign(mtmp); /* having finished peaceful changes */
-    if (anymon) {
+    if (anymon && !(mmflags & MM_NOGRP)) {
         if ((ptr->geno & G_SGROUP) && rn2(2)) {
             m_initsgrp(mtmp, mtmp->mx, mtmp->my, mmflags);
         } else if (ptr->geno & G_LGROUP) {
index 11067b931f6cae0df7dfebe9c39630ef9b22f477..35b0d937884b79ce9791efc7229004c5a86b4cff 100644 (file)
@@ -803,7 +803,7 @@ skip0:
         if (u.uhave.amulet || !rn2(3)) {
             x = somex(croom);
             y = somey(croom);
-            tmonst = makemon((struct permonst *) 0, x, y, NO_MM_FLAGS);
+            tmonst = makemon((struct permonst *) 0, x, y, (MM_NOGRP | MM_ASLEEP));
             if (tmonst && tmonst->data == &mons[PM_GIANT_SPIDER]
                 && !occupied(x, y))
                 (void) maketrap(x, y, WEB);