MCPcopy Create free account
hub / github.com/NetHack/NetHack / m_avoid_kicked_loc

Function m_avoid_kicked_loc

src/monmove.c:1296–1308  ·  view source on GitHub ↗

monster avoids a location nx, ny, if hero kicked that location */

Source from the content-addressed store, hash-verified

1294
1295/* monster avoids a location nx, ny, if hero kicked that location */
1296boolean
1297m_avoid_kicked_loc(struct monst *mtmp, coordxy nx, coordxy ny)
1298{
1299 if ((mtmp->mpeaceful || mtmp->mtame)
1300 && mtmp->mcansee
1301 && !mtmp->mconf && !mtmp->mstun
1302 && !Conflict
1303 && isok(gk.kickedloc.x, gk.kickedloc.y)
1304 && nx == gk.kickedloc.x && ny == gk.kickedloc.y
1305 && next2u(nx, ny))
1306 return TRUE;
1307 return FALSE;
1308}
1309
1310/* monster avoids a location nx, ny, if we're in sokoban, and
1311 there's a boulder between the location and hero */

Callers 2

dog_moveFunction · 0.85
m_moveFunction · 0.85

Calls 1

isokFunction · 0.85

Tested by

no test coverage detected