MCPcopy Index your code
hub / github.com/NetHack/NetHack / count_level_features

Function count_level_features

src/mklev.c:827–842  ·  view source on GitHub ↗

count the tracked features (sinks, fountains) present on the level */

Source from the content-addressed store, hash-verified

825
826/* count the tracked features (sinks, fountains) present on the level */
827void
828count_level_features(void)
829{
830 coordxy x, y;
831
832 svl.level.flags.nfountains = svl.level.flags.nsinks = 0;
833 for (y = 0; y < ROWNO; y++)
834 for (x = 1; x < COLNO; x++) {
835 int typ = levl[x][y].typ;
836
837 if (typ == FOUNTAIN)
838 svl.level.flags.nfountains++;
839 else if (typ == SINK)
840 svl.level.flags.nsinks++;
841 }
842}
843
844/* clear out various globals that keep information on the current level.
845 * some of this is only necessary for some types of levels (maze, normal,

Callers 4

wizterrainwishFunction · 0.85
set_levltypFunction · 0.85
lspo_finalize_levelFunction · 0.85
load_specialFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected