maybe fix #K3634 - failed migrating mov arrival
place_monster() sanity check complained that a long worm was being put at the same location as another monster. The long worm wasn't on the map prior to that place attempt. This probably fixes it but I don't a test case so am not sure.
This commit is contained in:
@@ -3292,16 +3292,23 @@ m_into_limbo(struct monst *mtmp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
migrate_mon(struct monst *mtmp, xint16 target_lev, xint16 xyloc)
|
migrate_mon(
|
||||||
|
struct monst *mtmp,
|
||||||
|
xint16 target_lev, /* destination level */
|
||||||
|
xint16 xyloc) /* MIGR_xxx flag for location within destination */
|
||||||
{
|
{
|
||||||
if (!mtmp->mx) {
|
/*
|
||||||
/* this was a failed arrival attempt from a prior migration;
|
* If mtmp->mx is zero, this was a failed arrival attempt from a
|
||||||
force mtmp to temporarily have a valid location when starting
|
* prior migration and mtmp isn't on the map. In that situation
|
||||||
its new migration */
|
* it can't be engulfing or holding the hero or held by same and
|
||||||
mtmp->mx = u.ux, mtmp->my = u.uy;
|
* should have dropped any special objects during that earlier
|
||||||
|
* migration back when it had a valid map location. So only
|
||||||
|
* perform some actions when mx is non-zero.
|
||||||
|
*/
|
||||||
|
if (mtmp->mx) {
|
||||||
|
unstuck(mtmp);
|
||||||
|
mdrop_special_objs(mtmp);
|
||||||
}
|
}
|
||||||
unstuck(mtmp);
|
|
||||||
mdrop_special_objs(mtmp);
|
|
||||||
migrate_to_level(mtmp, target_lev, xyloc, (coord *) 0);
|
migrate_to_level(mtmp, target_lev, xyloc, (coord *) 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user