returns how far beyond the normal capacity the player is currently. */ inv_weight() is negative if the player is below normal capacity. */
| 4348 | /* returns how far beyond the normal capacity the player is currently. */ |
| 4349 | /* inv_weight() is negative if the player is below normal capacity. */ |
| 4350 | int |
| 4351 | inv_weight(void) |
| 4352 | { |
| 4353 | struct obj *otmp = gi.invent; |
| 4354 | int wt = 0; |
| 4355 | |
| 4356 | while (otmp) { |
| 4357 | if (otmp->oclass == COIN_CLASS) |
| 4358 | wt += (int) (((long) otmp->quan + 50L) / 100L); |
| 4359 | else if (otmp->otyp != BOULDER || !throws_rocks(gy.youmonst.data)) |
| 4360 | wt += otmp->owt; |
| 4361 | otmp = otmp->nobj; |
| 4362 | } |
| 4363 | gw.wc = weight_cap(); |
| 4364 | return (wt - gw.wc); |
| 4365 | } |
| 4366 | |
| 4367 | /* |
| 4368 | * Returns 0 if below normal capacity, or the number of "capacity units" |
no test coverage detected