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

Function clear_conjoined_pits

src/trap.c:6579–6601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6577}
6578
6579staticfn void
6580clear_conjoined_pits(struct trap *trap)
6581{
6582 int diridx, adjidx;
6583 coordxy x, y;
6584 struct trap *t;
6585
6586 if (trap && is_pit(trap->ttyp)) {
6587 for (diridx = 0; diridx < N_DIRS; ++diridx) {
6588 if (trap->conjoined & (1 << diridx)) {
6589 x = trap->tx + xdir[diridx];
6590 y = trap->ty + ydir[diridx];
6591 if (isok(x, y)
6592 && (t = t_at(x, y)) != 0
6593 && is_pit(t->ttyp)) {
6594 adjidx = DIR_180(diridx);
6595 t->conjoined &= ~(1 << adjidx);
6596 }
6597 trap->conjoined &= ~(1 << diridx);
6598 }
6599 }
6600 }
6601}
6602
6603staticfn boolean
6604adj_nonconjoined_pit(struct trap *adjtrap)

Callers 1

deltrapFunction · 0.85

Calls 2

isokFunction · 0.85
t_atFunction · 0.85

Tested by

no test coverage detected