* Returns 0 if below normal capacity, or the number of "capacity units" * over the normal capacity the player is loaded. Max is 5. */
| 4369 | * over the normal capacity the player is loaded. Max is 5. |
| 4370 | */ |
| 4371 | int |
| 4372 | calc_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 | |
| 4384 | int |
| 4385 | near_capacity(void) |
no test coverage detected