guardian corpse, statue animation follow-up

- fix ring of protection from shape changers causing
  real monster to be created.
- add ability to get the character class monster from
  genus() or the species.
- use the character class monster when animating
  guardian corpses.
This commit is contained in:
nethack.allison
2003-08-19 14:41:54 +00:00
parent 61c3188405
commit 48ab2a434c
5 changed files with 31 additions and 21 deletions

View File

@@ -444,7 +444,16 @@ int *fail_reason;
*/
mon = makemon(&mons[PM_DOPPELGANGER], x, y,
NO_MINVENT|MM_NOCOUNTBIRTH|MM_ADJACENTOK);
if (mon) (void) newcham(mon, mptr, FALSE, FALSE);
if (mon) {
/* makemon() will set mon->cham to
* CHAM_ORDINARY if hero is wearing
* ring of protection from shape changers
* when makemon() is called, so we have to
* check the field before calling newcham().
*/
if (mon->cham == CHAM_DOPPELGANGER)
(void) newcham(mon, mptr, FALSE, FALSE);
}
} else
mon = makemon(mptr, x, y, (cause == ANIMATE_SPELL) ?
(NO_MINVENT | MM_ADJACENTOK) : NO_MINVENT);