| 3692 | } |
| 3693 | |
| 3694 | staticfn boolean |
| 3695 | isclearpath( |
| 3696 | coord *cc, |
| 3697 | int distance, |
| 3698 | schar dx, |
| 3699 | schar dy) |
| 3700 | { |
| 3701 | struct trap *t; |
| 3702 | uchar typ; |
| 3703 | coordxy x, y; |
| 3704 | |
| 3705 | x = cc->x; |
| 3706 | y = cc->y; |
| 3707 | while (distance-- > 0) { |
| 3708 | x += dx; |
| 3709 | y += dy; |
| 3710 | if (!isok(x, y)) |
| 3711 | return FALSE; |
| 3712 | typ = levl[x][y].typ; |
| 3713 | if (!ZAP_POS(typ) || closed_door(x, y)) |
| 3714 | return FALSE; |
| 3715 | if ((t = t_at(x, y)) != 0 |
| 3716 | && (is_pit(t->ttyp) || is_hole(t->ttyp) || is_xport(t->ttyp))) |
| 3717 | return FALSE; |
| 3718 | } |
| 3719 | cc->x = x; |
| 3720 | cc->y = y; |
| 3721 | return TRUE; |
| 3722 | } |
| 3723 | |
| 3724 | /* can monster escape from a pit easily */ |
| 3725 | staticfn boolean |
no test coverage detected