| 1508 | } |
| 1509 | |
| 1510 | staticfn int |
| 1511 | count_categories(struct obj *olist, int qflags) |
| 1512 | { |
| 1513 | char *pack; |
| 1514 | boolean counted_category; |
| 1515 | int ccount = 0; |
| 1516 | struct obj *curr; |
| 1517 | boolean do_worn = (qflags & WORN_TYPES) != 0; |
| 1518 | |
| 1519 | pack = flags.inv_order; |
| 1520 | do { |
| 1521 | counted_category = FALSE; |
| 1522 | for (curr = olist; curr; curr = FOLLOW(curr, qflags)) { |
| 1523 | if (curr->oclass == *pack) { |
| 1524 | if (do_worn && !(curr->owornmask |
| 1525 | & (W_ARMOR | W_ACCESSORY | W_WEAPONS))) |
| 1526 | continue; |
| 1527 | if (!counted_category) { |
| 1528 | ccount++; |
| 1529 | counted_category = TRUE; |
| 1530 | } |
| 1531 | } |
| 1532 | } |
| 1533 | pack++; |
| 1534 | } while (*pack); |
| 1535 | return ccount; |
| 1536 | } |
| 1537 | |
| 1538 | /* |
| 1539 | * How much the weight of the given container will change when the given |