| 444 | /* look through hero inventory for launcher matching ammo, |
| 445 | avoiding known cursed items. Returns NULL if no match. */ |
| 446 | staticfn struct obj * |
| 447 | find_launcher(struct obj *ammo) |
| 448 | { |
| 449 | struct obj *otmp, *oX; |
| 450 | |
| 451 | if (!ammo) |
| 452 | return (struct obj *) 0; |
| 453 | |
| 454 | for (oX = 0, otmp = gi.invent; otmp; otmp = otmp->nobj) { |
| 455 | if (otmp->cursed && otmp->bknown) |
| 456 | continue; /* known to be cursed, so skip */ |
| 457 | if (ammo_and_launcher(ammo, otmp)) { |
| 458 | if (otmp->bknown) |
| 459 | return otmp; /* known-B or known-U (known-C won't get here) */ |
| 460 | if (!oX) |
| 461 | oX = otmp; /* unknown-BUC; used if no known-BU item found */ |
| 462 | } |
| 463 | } |
| 464 | return oX; |
| 465 | } |
| 466 | |
| 467 | /* the #fire command -- throw from the quiver or use wielded polearm */ |
| 468 | int |