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

Function next_level

src/dungeon.c:1496–1514  ·  view source on GitHub ↗

goto the next level (or appropriate dungeon) */

Source from the content-addressed store, hash-verified

1494
1495/* goto the next level (or appropriate dungeon) */
1496void
1497next_level(boolean at_stairs)
1498{
1499 stairway *stway = stairway_at(u.ux, u.uy);
1500 d_level newlevel;
1501
1502 if (at_stairs && stway)
1503 stway->u_traversed = TRUE;
1504
1505 if (at_stairs && stway) {
1506 newlevel.dnum = stway->tolev.dnum;
1507 newlevel.dlevel = stway->tolev.dlevel;
1508 goto_level(&newlevel, at_stairs, FALSE, FALSE);
1509 } else {
1510 newlevel.dnum = u.uz.dnum;
1511 newlevel.dlevel = u.uz.dlevel + 1;
1512 goto_level(&newlevel, at_stairs, !at_stairs, FALSE);
1513 }
1514}
1515
1516/* goto the previous level (or appropriate dungeon) */
1517void

Callers 1

dodownFunction · 0.85

Calls 2

stairway_atFunction · 0.85
goto_levelFunction · 0.85

Tested by

no test coverage detected