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

@@ -1520,7 +1520,9 @@ mkcorpstat(
} else {
otmp = mksobj_at(objtype, x, y, init, FALSE);
}
otmp->norevive = g.mkcorpstat_norevive;
/* record gender and 'historic statue' in overloaded enchantment field */
otmp->spe = (corpstatflags & CORPSTAT_SPE_VAL);
otmp->norevive = g.mkcorpstat_norevive; /* via envrmt rather than flags */
/* when 'mtmp' is non-null save the monster's details with the
corpse or statue; it will also force the 'ptr' override below */
@@ -1685,10 +1687,10 @@ mk_tt_object(
never returns Null */
struct obj *
mk_named_object(
int objtype, /* CORPSE or STATUE */
struct permonst *ptr,
int x, int y,
const char *nm)
int objtype, /* CORPSE or STATUE */
struct permonst *ptr,
int x, int y,
const char *nm)
{
struct obj *otmp;
unsigned corpstatflags = (objtype != STATUE) ? CORPSTAT_INIT