| 698 | } |
| 699 | |
| 700 | staticfn boolean |
| 701 | place_niche( |
| 702 | struct mkroom *aroom, |
| 703 | int *dy, |
| 704 | coordxy *xx, coordxy *yy) |
| 705 | { |
| 706 | coord dd; |
| 707 | |
| 708 | if (rn2(2)) { |
| 709 | *dy = 1; |
| 710 | if (!finddpos(&dd, DIR_S, aroom)) |
| 711 | return FALSE; |
| 712 | } else { |
| 713 | *dy = -1; |
| 714 | if (!finddpos(&dd, DIR_N, aroom)) |
| 715 | return FALSE; |
| 716 | } |
| 717 | *xx = dd.x; |
| 718 | *yy = dd.y; |
| 719 | return (boolean) ((isok(*xx, *yy + *dy) |
| 720 | && levl[*xx][*yy + *dy].typ == STONE) |
| 721 | && (isok(*xx, *yy - *dy) |
| 722 | && !IS_POOL(levl[*xx][*yy - *dy].typ) |
| 723 | && !IS_FURNITURE(levl[*xx][*yy - *dy].typ)) |
| 724 | && cardinal_nextto_room(aroom, *xx, *yy)); |
| 725 | } |
| 726 | |
| 727 | /* there should be one of these per trap, in the same order as trap.h */ |
| 728 | static NEARDATA const char *trap_engravings[TRAPNUM] = { |
no test coverage detected