| 473 | } while (0) |
| 474 | |
| 475 | staticfn struct obj * |
| 476 | oselect(struct monst *mtmp, int type) |
| 477 | { |
| 478 | struct obj *otmp; |
| 479 | |
| 480 | for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) { |
| 481 | if (otmp->otyp != type) |
| 482 | continue; |
| 483 | |
| 484 | /* never select non-cockatrice corpses */ |
| 485 | if ((type == CORPSE || type == EGG) |
| 486 | && (otmp->corpsenm == NON_PM |
| 487 | || !touch_petrifies(&mons[otmp->corpsenm]))) |
| 488 | continue; |
| 489 | |
| 490 | if (!can_touch_safely(mtmp, otmp)) |
| 491 | continue; |
| 492 | |
| 493 | return otmp; |
| 494 | } |
| 495 | return (struct obj *) 0; |
| 496 | } |
| 497 | |
| 498 | static NEARDATA const int rwep[] = { |
| 499 | DWARVISH_SPEAR, SILVER_SPEAR, ELVEN_SPEAR, SPEAR, ORCISH_SPEAR, JAVELIN, |
no test coverage detected