MCPcopy Create free account
hub / github.com/NetHack/NetHack / join_adjacent_pits

Function join_adjacent_pits

src/trap.c:6621–6641  ·  view source on GitHub ↗

* Mark all neighboring pits as conjoined pits. * (currently not called from anywhere) */

Source from the content-addressed store, hash-verified

6619 * (currently not called from anywhere)
6620 */
6621staticfn void
6622join_adjacent_pits(struct trap *trap)
6623{
6624 struct trap *t;
6625 int diridx;
6626 coordxy x, y;
6627
6628 if (!trap)
6629 return;
6630 for (diridx = 0; diridx < N_DIRS; ++diridx) {
6631 x = trap->tx + xdir[diridx];
6632 y = trap->ty + ydir[diridx];
6633 if (isok(x, y)) {
6634 if ((t = t_at(x, y)) != 0 && is_pit(t->ttyp)) {
6635 trap->conjoined |= (1 << diridx);
6636 join_adjacent_pits(t);
6637 } else
6638 trap->conjoined &= ~(1 << diridx);
6639 }
6640 }
6641}
6642#endif /*0*/
6643
6644/*

Callers

nothing calls this directly

Calls 2

isokFunction · 0.85
t_atFunction · 0.85

Tested by

no test coverage detected