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

Function count_traps

src/trap.c:6515–6528  ·  view source on GitHub ↗

return number of traps of type ttyp on this level */

Source from the content-addressed store, hash-verified

6513
6514/* return number of traps of type ttyp on this level */
6515int
6516count_traps(int ttyp)
6517{
6518 int ret = 0;
6519 struct trap *trap = gf.ftrap;
6520
6521 while (trap) {
6522 if ((int) trap->ttyp == ttyp)
6523 ret++;
6524 trap = trap->ntrap;
6525 }
6526
6527 return ret;
6528}
6529
6530void
6531deltrap(struct trap *trap)

Callers 1

maybe_spin_webFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected