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

Function will_hurtle

src/dothrow.c:976–989  ·  view source on GitHub ↗

used by mhurtle_step() for actual hurtling and also to vary message if target will/won't change location when knocked back */

Source from the content-addressed store, hash-verified

974/* used by mhurtle_step() for actual hurtling and also to vary message
975 if target will/won't change location when knocked back */
976boolean
977will_hurtle(struct monst *mon, coordxy x, coordxy y)
978{
979 if (!isok(x, y))
980 return FALSE;
981 /* redundant when called by mhurtle() but needed for mhitm_knockback() */
982 if (mon->data->msize >= MZ_HUGE || mon == u.ustuck || mon->mtrapped)
983 return FALSE;
984 /*
985 * TODO: Treat walls, doors, iron bars, etc. specially
986 * rather than just stopping before.
987 */
988 return goodpos(x, y, mon, MM_IGNOREWATER | MM_IGNORELAVA);
989}
990
991staticfn boolean
992mhurtle_step(genericptr_t arg, coordxy x, coordxy y)

Callers 2

mhitm_knockbackFunction · 0.85
mhurtle_stepFunction · 0.85

Calls 2

isokFunction · 0.85
goodposFunction · 0.85

Tested by

no test coverage detected