class differentiation bit (trunk only)

Healers pick up on the fact that a wand of undead turning
revived a creature.
This commit is contained in:
nethack.allison
2003-10-25 22:20:24 +00:00
parent cd7e1163e1
commit b4c2f74c22
3 changed files with 45 additions and 1 deletions

View File

@@ -926,6 +926,30 @@ boolean init;
return(otmp);
}
/*
* Return the type of monster that this corpse will
* revive as, even if it has a monster structure
* attached to it. In that case, you can't just
* use obj->corpsenm, because the stored monster
* type can, and often is, different.
* The return value is an index into mons[].
*/
int
corpse_revive_type(obj)
struct obj *obj;
{
int revivetype;
struct monst *mtmp;
if (obj->oxlth && obj->oattached == OATTACHED_MONST &&
((mtmp = get_mtraits(obj, FALSE)) != (struct monst *)0)) {
/* mtmp is a temporary pointer to a monster's stored
attributes, not a real monster */
revivetype = mtmp->mnum;
} else
revivetype = obj->corpsenm;
return revivetype;
}
/*
* Attach a monster id to an object, to provide
* a lasting association between the two.