From 4b20ed6211a39afe2a029952b848bd9edd46b2f6 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Thu, 2 Dec 2021 18:45:57 -0500 Subject: [PATCH] Fix: gender, historicity of stoned monster statue The way statues of stoned unique monsters were marked as "historic" was not changed when mkcorpstat flags were updated in 04a8ddc, resulting in unique statues which were no longer marked as historic and were instead marked as female. While fixing that, also use the gender-related mkcorpstat flags to assign the gender of a stoned monster to the resulting statue. --- src/mon.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mon.c b/src/mon.c index ca19ed4bc..d01f1095d 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2695,6 +2695,7 @@ monstone(struct monst* mdef) if ((int) mdef->data->msize > MZ_TINY || !rn2(2 + ((int) (mdef->data->geno & G_FREQ) > 2))) { + unsigned corpstatflags = CORPSTAT_NONE; oldminvent = 0; /* some objects may end up outside the statue */ while ((obj = mdef->minvent) != 0) { @@ -2719,7 +2720,14 @@ monstone(struct monst* mdef) /* defer statue creation until after inventory removal so that saved monster traits won't retain any stale item-conferred attributes */ - otmp = mkcorpstat(STATUE, mdef, mdef->data, x, y, CORPSTAT_NONE); + if (mdef->female) + corpstatflags |= CORPSTAT_FEMALE; + else if (!is_neuter(mdef->data)) + corpstatflags |= CORPSTAT_MALE; + /* Archeologists should not break unique statues */ + if (mdef->data->geno & G_UNIQ) + corpstatflags |= CORPSTAT_HISTORIC; + otmp = mkcorpstat(STATUE, mdef, mdef->data, x, y, corpstatflags); if (has_mgivenname(mdef)) otmp = oname(otmp, MGIVENNAME(mdef)); while ((obj = oldminvent) != 0) { @@ -2727,9 +2735,6 @@ monstone(struct monst* mdef) obj->nobj = 0; /* avoid merged-> obfree-> dealloc_obj-> panic */ (void) add_to_container(otmp, obj); } - /* Archeologists should not break unique statues */ - if (mdef->data->geno & G_UNIQ) - otmp->spe = 1; otmp->owt = weight(otmp); } else otmp = mksobj_at(ROCK, x, y, TRUE, FALSE);