fix "unique monster doppelganger and bones bug"
Reported by paxed 8 years ago: if a bones file contains a doppelganger imitating a unique monster, when it gets loaded that monster ends up being marked as having been created. The doppelganger itself will shapechange to other forms, but the unique monster won't be created when it should be because it has become extinct. Report involved creating a statue of a unique monster which yields a doppelganger in that monster's shape, then using stone to flesh to animate the statue, dying before it changes to some other shape, and having bones be saved.
This commit is contained in:
@@ -402,7 +402,9 @@ restmonchn(NHFILE* nhfp)
|
||||
offset = mtmp->mnum;
|
||||
mtmp->data = &mons[offset];
|
||||
if (ghostly) {
|
||||
int mndx = monsndx(mtmp->data);
|
||||
int mndx = (mtmp->cham == NON_PM) ? monsndx(mtmp->data)
|
||||
: mtmp->cham;
|
||||
|
||||
if (propagate(mndx, TRUE, ghostly) == 0) {
|
||||
/* cookie to trigger purge in getbones() */
|
||||
mtmp->mhpmax = DEFUNCT_MONSTER;
|
||||
|
||||
Reference in New Issue
Block a user