From 3d246074946abb417bcecee80d88db73aa9c905f Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 16 Mar 2023 02:24:52 -0700 Subject: [PATCH] fix #K3860 - figurine of an Angel If asked to create an Angel when MM_EMIN isn't specified, makemon() will either create an ordinary monster of type Angel without any emin extension or add emin and create a minion affiliated with the god for randomly chosen alignment. Figurines didn't specify emin so could result in either type, but wishing for them offered no opportunity to specify alignment for the second type. Change figurine activation to force the first type: an ordinary monster of type Angel, not affiliated with any particular deity. --- src/dog.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/dog.c b/src/dog.c index 5c411ceec..0e8fd7f4e 100644 --- a/src/dog.c +++ b/src/dog.c @@ -116,10 +116,24 @@ make_familiar(struct obj *otmp, coordxy x, coordxy y, boolean quietly) : (cgend == CORPSTAT_MALE) ? MM_MALE : 0L); mtmp = makemon(pm, x, y, mmflags); - if (otmp && !mtmp) { /* monster was genocided or square occupied */ - if (!quietly) - pline_The("figurine writhes and then shatters into pieces!"); - break; + if (otmp) { /* figurine */ + if (!mtmp) { + /* monster has been genocided or target spot is occupied */ + if (!quietly) + pline_The( + "figurine writhes and then shatters into pieces!"); + break; + } else if (mtmp->isminion) { + /* Fixup for figurine of an Angel: makemon() is willing to + create a random Angel as either an ordinary monster or as + a minion of random allegiance. We don't want the latter + here in case it successfully becomes a pet. */ + mtmp->isminion = 0; + free_emin(mtmp); + /* [This could and possibly should be redone as a new + MM_flag passed to makemon() to suppress making a minion + so that no post-creation fixup would be needed.] */ + } } } while (!mtmp && --trycnt > 0);