fix #H7530 - corpse from corpseless monster

Migrating monster attempting to arrive on a level which is already
full of monsters gets killed off.  It was leaving a corpse without
regard for whether it was a type of of monster which should never
leave corpses.

I'd prefer that it be put back on the migrating_mons list rather
than be killed off, but this just suppresses impossible corpses.
This commit is contained in:
PatR
2018-11-20 13:13:23 -08:00
parent ffac5f1a65
commit d15dacc44c
3 changed files with 29 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ STATIC_DCL struct obj *FDECL(make_corpse, (struct monst *, unsigned));
STATIC_DCL void FDECL(m_detach, (struct monst *, struct permonst *));
STATIC_DCL void FDECL(lifesaved_monster, (struct monst *));
/* note: duplicated in dog.c */
#define LEVEL_SPECIFIC_NOCORPSE(mdat) \
(Is_rogue_level(&u.uz) \
|| (level.flags.graveyard && is_undead(mdat) && rn2(3)))
@@ -446,7 +447,8 @@ unsigned corpseflags;
}
/* All special cases should precede the G_NOCORPSE check */
if (!obj) return NULL;
if (!obj)
return (struct obj *) 0;
/* if polymorph or undead turning has killed this monster,
prevent the same attack beam from hitting its corpse */