fix github issue #531 - genderless corpses

Dead monsters that had traits saved with the corpse would revive as
the same gender, but ordinary corpses revived with random gender so
could be different from before they got killed.

Since corpses of monsters lacked gender, those for monsters with
gender-specific names were described by the neuter name.

This is a fairly big change for a fairly minor problem and needs a
lot more testing.

Fixes #531
This commit is contained in:
PatR
2021-06-08 03:43:46 -07:00
parent 14b2330fd6
commit 04a8ddcce1
12 changed files with 121 additions and 66 deletions

View File

@@ -480,7 +480,7 @@ pm_to_cham(int mndx)
* etc....
*/
static struct obj *
make_corpse(register struct monst* mtmp, unsigned int corpseflags)
make_corpse(struct monst *mtmp, unsigned int corpseflags)
{
register struct permonst *mdat = mtmp->data;
int num;
@@ -491,6 +491,11 @@ make_corpse(register struct monst* mtmp, unsigned int corpseflags)
unsigned corpstatflags = corpseflags;
boolean burythem = ((corpstatflags & CORPSTAT_BURIED) != 0);
if (mtmp->female)
corpstatflags |= CORPSTAT_FEMALE;
else if (!is_neuter(mtmp->data))
corpstatflags |= CORPSTAT_MALE;
switch (mndx) {
case PM_GRAY_DRAGON:
case PM_SILVER_DRAGON:
@@ -578,8 +583,8 @@ make_corpse(register struct monst* mtmp, unsigned int corpseflags)
break;
case PM_STONE_GOLEM:
corpstatflags &= ~CORPSTAT_INIT;
obj =
mkcorpstat(STATUE, (struct monst *) 0, mdat, x, y, corpstatflags);
obj = mkcorpstat(STATUE, (struct monst *) 0, mdat, x, y,
corpstatflags);
break;
case PM_WOOD_GOLEM:
num = d(2, 4);