From a1c1acdd2423300a7771a2ab3001ffb51c0ce861 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 7 Dec 2018 09:29:01 -0500 Subject: [PATCH] add MM_NOGRP makemon() flag 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 | 3 +++ include/hack.h | 1 + src/makemon.c | 6 ++---- src/mklev.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 421792d38..538c632ca 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -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 diff --git a/include/hack.h b/include/hack.h index beab7da8a..e59693d5f 100644 --- a/include/hack.h +++ b/include/hack.h @@ -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 diff --git a/src/makemon.c b/src/makemon.c index e4d799e9b..20912b8da 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -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) { diff --git a/src/mklev.c b/src/mklev.c index 11067b931..35b0d9378 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -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);