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

Function builds_up

src/dungeon.c:1476–1493  ·  view source on GitHub ↗

returns True iff the branch 'lev' is in a branch which builds up */

Source from the content-addressed store, hash-verified

1474
1475/* returns True iff the branch 'lev' is in a branch which builds up */
1476boolean
1477builds_up(d_level *lev)
1478{
1479 dungeon *dptr = &svd.dungeons[lev->dnum];
1480 branch *br;
1481 if (dptr->num_dunlevs > 1)
1482 return (boolean) (dptr->entry_lev == dptr->num_dunlevs);
1483 /* else, single-level branch; find branch connection that connects this
1484 * dungeon from a parent dungeon and determine whether it builds up from
1485 * that */
1486 for (br = svb.branches; br; br = br->next) {
1487 if (on_level(lev, &br->end2)) {
1488 return br->end1_up;
1489 }
1490 }
1491 impossible("builds_up: can't find branch for dungeon %d", lev->dnum);
1492 return FALSE;
1493}
1494
1495/* goto the next level (or appropriate dungeon) */
1496void

Callers 5

goto_levelFunction · 0.85
choose_stairsFunction · 0.85
level_difficultyFunction · 0.85
print_mapseenFunction · 0.85
mon_arriveFunction · 0.85

Calls 2

on_levelFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected