this is checking whether a trap symbol represents a trapped door, not whether the door here is actually trapped */
| 179 | /* this is checking whether a trap symbol represents a trapped door, |
| 180 | not whether the door here is actually trapped */ |
| 181 | boolean |
| 182 | trapped_door_at(int ttyp, coordxy x, coordxy y) |
| 183 | { |
| 184 | struct rm *lev; |
| 185 | |
| 186 | if (!glyph_is_trap(glyph_at(x, y))) |
| 187 | return FALSE; |
| 188 | if (ttyp != TRAPPED_DOOR || (Hallucination && rn2(20))) |
| 189 | return FALSE; |
| 190 | lev = &levl[x][y]; |
| 191 | if (!IS_DOOR(lev->typ)) |
| 192 | return FALSE; |
| 193 | if ((lev->doormask & (D_NODOOR | D_BROKEN | D_ISOPEN)) != 0 |
| 194 | && trapped_chest_at(ttyp, x, y)) |
| 195 | return FALSE; |
| 196 | return TRUE; |
| 197 | } |
| 198 | |
| 199 | /* recursively search obj for an object in class oclass, return 1st found */ |
| 200 | struct obj * |
no test coverage detected