Wake up monsters near some particular location. */
| 4371 | |
| 4372 | /* Wake up monsters near some particular location. */ |
| 4373 | staticfn void |
| 4374 | wake_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 | |
| 4401 | void |
| 4402 | wake_nearto(coordxy x, coordxy y, int distance) |
no test coverage detected