return True if surrounded by impassible rock, regardless of the state of your own location (for example, inside a doorless closet) */
| 158 | /* return True if surrounded by impassible rock, regardless of the state |
| 159 | of your own location (for example, inside a doorless closet) */ |
| 160 | boolean |
| 161 | stuck_in_wall(void) |
| 162 | { |
| 163 | int i, j, x, y, count = 0; |
| 164 | |
| 165 | if (Passes_walls) |
| 166 | return FALSE; |
| 167 | for (i = -1; i <= 1; i++) { |
| 168 | x = u.ux + i; |
| 169 | for (j = -1; j <= 1; j++) { |
| 170 | if (!i && !j) |
| 171 | continue; |
| 172 | y = u.uy + j; |
| 173 | if (!isok(x, y) |
| 174 | || (IS_OBSTRUCTED(levl[x][y].typ) |
| 175 | && (levl[x][y].typ != SDOOR && levl[x][y].typ != SCORR)) |
| 176 | || (blocked_boulder(i, j) && !throws_rocks(gy.youmonst.data))) |
| 177 | ++count; |
| 178 | } |
| 179 | } |
| 180 | return (count == 8) ? TRUE : FALSE; |
| 181 | } |
| 182 | |
| 183 | /* |
| 184 | * Return 0 if nothing particular seems wrong, positive numbers for |
no test coverage detected