used by drown() to check whether hero can crawl from water to ; also used by findtravelpath() when destination is one step away */
| 4076 | /* used by drown() to check whether hero can crawl from water to <x,y>; |
| 4077 | also used by findtravelpath() when destination is one step away */ |
| 4078 | boolean |
| 4079 | crawl_destination(coordxy x, coordxy y) |
| 4080 | { |
| 4081 | /* is location ok in general? */ |
| 4082 | if (!goodpos(x, y, &gy.youmonst, 0)) |
| 4083 | return FALSE; |
| 4084 | |
| 4085 | /* orthogonal movement is unrestricted when destination is ok */ |
| 4086 | if (x == u.ux || y == u.uy) |
| 4087 | return TRUE; |
| 4088 | |
| 4089 | /* diagonal movement has some restrictions */ |
| 4090 | if (NODIAG(u.umonnum)) |
| 4091 | return FALSE; /* poly'd into a grid bug... */ |
| 4092 | if (Passes_walls) |
| 4093 | return TRUE; /* or a xorn... */ |
| 4094 | /* pool could be next to a door, conceivably even inside a shop */ |
| 4095 | if (IS_DOOR(levl[x][y].typ) && (!doorless_door(x, y) || block_door(x, y))) |
| 4096 | return FALSE; |
| 4097 | /* finally, are we trying to squeeze through a too-narrow gap? */ |
| 4098 | return !(bad_rock(gy.youmonst.data, u.ux, y) |
| 4099 | && bad_rock(gy.youmonst.data, x, u.uy) |
| 4100 | && cant_squeeze_thru(&gy.youmonst)); |
| 4101 | } |
| 4102 | |
| 4103 | /* something like lookaround, but we are not running */ |
| 4104 | /* react only to monsters that might hit us */ |
no test coverage detected