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:
13
src/zap.c
13
src/zap.c
@@ -856,6 +856,16 @@ revive(struct obj *corpse, boolean by_hero)
|
||||
if (!mtmp)
|
||||
return (struct monst *) 0;
|
||||
|
||||
/* if we didn't use montraits, corpse might specify mon's gender */
|
||||
if (!has_omonst(corpse)) {
|
||||
int cspe = (corpse->spe & CORPSTAT_GENDER);
|
||||
|
||||
if (cspe == CORPSTAT_MALE)
|
||||
mtmp->female = 0;
|
||||
else if (cspe == CORPSTAT_FEMALE)
|
||||
mtmp->female = 1;
|
||||
}
|
||||
|
||||
/* hiders shouldn't already be re-hidden when they revive */
|
||||
if (mtmp->mundetected) {
|
||||
mtmp->mundetected = 0;
|
||||
@@ -4896,7 +4906,8 @@ break_statue(struct obj *obj)
|
||||
obj_extract_self(item);
|
||||
place_object(item, obj->ox, obj->oy);
|
||||
}
|
||||
if (by_you && Role_if(PM_ARCHEOLOGIST) && (obj->spe & STATUE_HISTORIC)) {
|
||||
if (by_you && Role_if(PM_ARCHEOLOGIST)
|
||||
&& (obj->spe & CORPSTAT_HISTORIC)) {
|
||||
You_feel("guilty about damaging such a historic statue.");
|
||||
adjalign(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user