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:
PatR
2022-07-16 06:36:45 -07:00
parent cb036d11e2
commit fcbeed21cc
2 changed files with 3 additions and 0 deletions

View File

@@ -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;
}