| 6549 | } |
| 6550 | |
| 6551 | boolean |
| 6552 | conjoined_pits( |
| 6553 | struct trap *trap2, |
| 6554 | struct trap *trap1, |
| 6555 | boolean u_entering_trap2) |
| 6556 | { |
| 6557 | coordxy dx, dy; |
| 6558 | int diridx, adjidx; |
| 6559 | |
| 6560 | if (!trap1 || !trap2) |
| 6561 | return FALSE; |
| 6562 | if (!isok(trap2->tx, trap2->ty) || !isok(trap1->tx, trap1->ty) |
| 6563 | || !is_pit(trap2->ttyp) |
| 6564 | || !is_pit(trap1->ttyp) |
| 6565 | || (u_entering_trap2 && !(u.utrap && u.utraptype == TT_PIT))) |
| 6566 | return FALSE; |
| 6567 | dx = sgn(trap2->tx - trap1->tx); |
| 6568 | dy = sgn(trap2->ty - trap1->ty); |
| 6569 | diridx = xytodir(dx, dy); |
| 6570 | if (diridx != DIR_ERR) { |
| 6571 | adjidx = DIR_180(diridx); |
| 6572 | if ((trap1->conjoined & (1 << diridx)) |
| 6573 | && (trap2->conjoined & (1 << adjidx))) |
| 6574 | return TRUE; |
| 6575 | } |
| 6576 | return FALSE; |
| 6577 | } |
| 6578 | |
| 6579 | staticfn void |
| 6580 | clear_conjoined_pits(struct trap *trap) |
no test coverage detected