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

Function calc_capacity

src/hack.c:4371–4382  ·  view source on GitHub ↗

* Returns 0 if below normal capacity, or the number of "capacity units" * over the normal capacity the player is loaded. Max is 5. */

Source from the content-addressed store, hash-verified

4369 * over the normal capacity the player is loaded. Max is 5.
4370 */
4371int
4372calc_capacity(int xtra_wt)
4373{
4374 int cap, wt = inv_weight() + xtra_wt;
4375
4376 if (wt <= 0)
4377 return UNENCUMBERED;
4378 if (gw.wc <= 1)
4379 return OVERLOADED;
4380 cap = (wt * 2 / gw.wc) + 1;
4381 return min(cap, OVERLOADED);
4382}
4383
4384int
4385near_capacity(void)

Callers 5

near_capacityFunction · 0.85
throwitFunction · 0.85
lift_objectFunction · 0.85
try_liftFunction · 0.85
u_catch_thrown_objFunction · 0.85

Calls 1

inv_weightFunction · 0.85

Tested by

no test coverage detected