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

Function hole_destination

src/trap.c:441–453  ·  view source on GitHub ↗

destination dlevel for holes or trapdoors */

Source from the content-addressed store, hash-verified

439
440/* destination dlevel for holes or trapdoors */
441staticfn void
442hole_destination(d_level *dst)
443{
444 int bottom = dng_bottom(&u.uz);
445
446 dst->dnum = u.uz.dnum;
447 dst->dlevel = dunlev(&u.uz);
448 while (dst->dlevel < bottom) {
449 dst->dlevel++;
450 if (rn2(4))
451 break;
452 }
453}
454
455struct trap *
456maketrap(coordxy x, coordxy y, int typ)

Callers 1

maketrapFunction · 0.85

Calls 3

dng_bottomFunction · 0.85
dunlevFunction · 0.85
rn2Function · 0.85

Tested by

no test coverage detected