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

Function wake_nearto_core

src/mon.c:4373–4399  ·  view source on GitHub ↗

Wake up monsters near some particular location. */

Source from the content-addressed store, hash-verified

4371
4372/* Wake up monsters near some particular location. */
4373staticfn void
4374wake_nearto_core(coordxy x, coordxy y, int distance, boolean petcall)
4375{
4376 struct monst *mtmp;
4377
4378 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
4379 if (DEADMONSTER(mtmp))
4380 continue;
4381 if (distance == 0 || dist2(mtmp->mx, mtmp->my, x, y) < distance) {
4382 /* sleep for N turns uses mtmp->mfrozen, but so does paralysis
4383 so we leave mfrozen monsters alone */
4384 wake_msg(mtmp, FALSE);
4385 mtmp->msleeping = 0; /* wake indeterminate sleep */
4386 if (!(mtmp->data->geno & G_UNIQ))
4387 mtmp->mstrategy &= ~STRAT_WAITMASK; /* wake 'meditation' */
4388 if (svc.context.mon_moving || !petcall)
4389 continue;
4390 if (mtmp->mtame) {
4391 if (!mtmp->isminion)
4392 EDOG(mtmp)->whistletime = svm.moves;
4393 /* Fix up a pet who is stuck "fleeing" its master */
4394 mon_track_clear(mtmp);
4395 }
4396 }
4397 }
4398 disturb_buried_zombies(x, y);
4399}
4400
4401void
4402wake_nearto(coordxy x, coordxy y, int distance)

Callers 2

wake_nearbyFunction · 0.85
wake_neartoFunction · 0.85

Calls 4

dist2Function · 0.85
wake_msgFunction · 0.85
mon_track_clearFunction · 0.85
disturb_buried_zombiesFunction · 0.85

Tested by

no test coverage detected