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

Function print_branch

src/dungeon.c:2262–2286  ·  view source on GitHub ↗

Print all child branches between the lower and upper bounds. */

Source from the content-addressed store, hash-verified

2260
2261/* Print all child branches between the lower and upper bounds. */
2262staticfn void
2263print_branch(
2264 winid win,
2265 int dnum, int lower_bound, int upper_bound,
2266 boolean bymenu, struct lchoice *lchoices_p)
2267{
2268 branch *br;
2269 char buf[BUFSZ];
2270
2271 /* This assumes that end1 is the "parent". */
2272 for (br = svb.branches; br; br = br->next) {
2273 if (br->end1.dnum == dnum && lower_bound < br->end1.dlevel
2274 && br->end1.dlevel <= upper_bound) {
2275 Sprintf(buf, "%c %s to %s: %d",
2276 bymenu ? chr_u_on_lvl(&br->end1) : ' ',
2277 br_string(br->type),
2278 svd.dungeons[br->end2.dnum].dname, depth(&br->end1));
2279 if (bymenu)
2280 tport_menu(win, buf, lchoices_p, &br->end1,
2281 unreachable_level(&br->end1, FALSE));
2282 else
2283 putstr(win, 0, buf);
2284 }
2285 }
2286}
2287
2288/* Print available dungeon information. */
2289schar

Callers 1

print_dungeonFunction · 0.85

Calls 5

chr_u_on_lvlFunction · 0.85
br_stringFunction · 0.85
depthFunction · 0.85
tport_menuFunction · 0.85
unreachable_levelFunction · 0.85

Tested by

no test coverage detected