montraits vs monst->mstate
The new test in m_detach(mon) to check whether mon was already detached is being tripped for trolls who died, revived, and died again. Clear out the MON_DETACH bit when saving montraits.
This commit is contained in:
@@ -1018,6 +1018,8 @@ makemap_unmakemon(struct monst *mtmp, boolean migratory)
|
||||
so that dmonsfree() bookkeeping for number of dead or removed
|
||||
monsters won't get out of sync; it is not on the map but
|
||||
mongone() -> m_detach() -> mon_leaving_level() copes with that */
|
||||
mtmp->mstate |= MON_OFFMAP;
|
||||
mtmp->mstate &= ~(MON_MIGRATING | MON_LIMBO);
|
||||
mtmp->nmon = fmon;
|
||||
fmon = mtmp;
|
||||
}
|
||||
|
||||
@@ -1982,6 +1982,7 @@ save_mtraits(struct obj *obj, struct monst *mtmp)
|
||||
mtmp2->mhp = mtmp2->mhpmax;
|
||||
if (mtmp2->mhp < 1)
|
||||
mtmp2->mhp = 0;
|
||||
mtmp2->mstate &= ~MON_DETACH;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user