Fix monster trapped state being wrong
When cloning a monster, clear the clone trapped and hiding states. When splitting a monster (eg. a black pudding), the clone could be placed on a trap, so do mintrap. When removing a monster from the map, clear the trapped state.
This commit is contained in:
@@ -419,7 +419,8 @@ register struct monst *magr, *mdef;
|
||||
|| objects[otmp->otyp].oc_material == METAL))
|
||||
&& mdef->mhp > 1
|
||||
&& !mdef->mcan) {
|
||||
if (clone_mon(mdef, 0, 0)) {
|
||||
struct monst *mclone;
|
||||
if ((mclone = clone_mon(mdef, 0, 0)) != 0) {
|
||||
if (vis && canspotmon(mdef)) {
|
||||
char buf[BUFSZ];
|
||||
|
||||
@@ -427,6 +428,7 @@ register struct monst *magr, *mdef;
|
||||
pline("%s divides as %s hits it!", buf,
|
||||
mon_nam(magr));
|
||||
}
|
||||
mintrap(mclone);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user