MCPcopy Index your code
hub / github.com/NetHack/NetHack / migrate_mon

Function migrate_mon

src/mon.c:3842–3861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3840}
3841
3842void
3843migrate_mon(
3844 struct monst *mtmp,
3845 xint16 target_lev, /* destination level */
3846 xint16 xyloc) /* MIGR_xxx flag for location within destination */
3847{
3848 /*
3849 * If mtmp->mx is zero, this was a failed arrival attempt from a
3850 * prior migration and mtmp isn't on the map. In that situation
3851 * it can't be engulfing or holding the hero or held by same and
3852 * should have dropped any special objects during that earlier
3853 * migration back when it had a valid map location. So only
3854 * perform some actions when mx is non-zero.
3855 */
3856 if (mtmp->mx) {
3857 unstuck(mtmp);
3858 mdrop_special_objs(mtmp);
3859 }
3860 migrate_to_level(mtmp, target_lev, xyloc, (coord *) 0);
3861}
3862
3863staticfn boolean
3864ok_to_obliterate(struct monst *mtmp)

Callers 3

invoke_banishFunction · 0.85
m_into_limboFunction · 0.85
elemental_clogFunction · 0.85

Calls 3

unstuckFunction · 0.85
mdrop_special_objsFunction · 0.85
migrate_to_levelFunction · 0.85

Tested by

no test coverage detected