figure out whether 'mon' (usually youmonst) is carrying the magic key */
| 2787 | |
| 2788 | /* figure out whether 'mon' (usually youmonst) is carrying the magic key */ |
| 2789 | struct obj * |
| 2790 | has_magic_key(struct monst *mon) /* if null, hero assumed */ |
| 2791 | { |
| 2792 | struct obj *o; |
| 2793 | short key = artilist[ART_MASTER_KEY_OF_THIEVERY].otyp; |
| 2794 | |
| 2795 | if (!mon) |
| 2796 | mon = &gy.youmonst; |
| 2797 | for (o = ((mon == &gy.youmonst) ? gi.invent : mon->minvent); o; |
| 2798 | o = nxtobj(o, key, FALSE)) { |
| 2799 | if (is_magic_key(mon, o)) |
| 2800 | return o; |
| 2801 | } |
| 2802 | return (struct obj *) 0; |
| 2803 | } |
| 2804 | |
| 2805 | /* #define is_art(o,art) ((o) && (o)->oartifact == (art)) */ |
| 2806 |
no test coverage detected