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

Function confdir

src/cmd.c:4299–4310  ·  view source on GitHub ↗

if hero is impaired, pick random movement direction */

Source from the content-addressed store, hash-verified

4297
4298/* if hero is impaired, pick random movement direction */
4299void
4300confdir(boolean force_impairment)
4301{
4302 if (force_impairment || u_maybe_impaired()) {
4303 int kmax = NODIAG(u.umonnum) ? (N_DIRS / 2) : N_DIRS,
4304 k = (int) dirs_ord[rn2(kmax)];
4305
4306 u.dx = xdir[k];
4307 u.dy = ydir[k];
4308 }
4309 return;
4310}
4311
4312const char *
4313directionname(int dir)

Callers 6

impaired_movementFunction · 0.85
slip_or_tripFunction · 0.85
use_pick_axe2Function · 0.85
use_stethoscopeFunction · 0.85
use_whipFunction · 0.85
getdirFunction · 0.85

Calls 2

u_maybe_impairedFunction · 0.85
rn2Function · 0.85

Tested by

no test coverage detected