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

Function skiprange

src/zap.c:3578–3588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3576}
3577
3578staticfn void
3579skiprange(int range, int *skipstart, int *skipend)
3580{
3581 int tr = (range / 4);
3582 int tmp = range - ((tr > 0) ? rnd(tr) : 0);
3583
3584 *skipstart = tmp;
3585 *skipend = tmp - ((tmp / 4) * rnd(3));
3586 if (*skipend >= tmp)
3587 *skipend = tmp - 1;
3588}
3589
3590/* Maybe explode a trap hit by object otmp's effect;
3591 cancellation beam hitting a magical trap causes an explosion.

Callers 1

bhitFunction · 0.85

Calls 1

rndFunction · 0.85

Tested by

no test coverage detected