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

Function trquan

src/u_init.c:1108–1114  ·  view source on GitHub ↗

randomizes the quantity given a trobj description */

Source from the content-addressed store, hash-verified

1106
1107/* randomizes the quantity given a trobj description */
1108staticfn long
1109trquan(const struct trobj *trop)
1110{
1111 if (!trop->trquan_min)
1112 return 1;
1113 return trop->trquan_min + rn2(trop->trquan_max - trop->trquan_min + 1);
1114}
1115
1116/* create random object of certain class, filtering out too powerful items */
1117staticfn struct obj *

Callers 2

ini_inv_adjust_objFunction · 0.85
ini_invFunction · 0.85

Calls 1

rn2Function · 0.85

Tested by

no test coverage detected