* Get the units carried weight in strength units. * @param draggingItem item to ignore * @return weight */
| 2431 | * @return weight |
| 2432 | */ |
| 2433 | int BattleUnit::getCarriedWeight(BattleItem *draggingItem) const |
| 2434 | { |
| 2435 | int weight = _armor->getWeight(); |
| 2436 | for (std::vector<BattleItem*>::const_iterator i = _inventory.begin(); i != _inventory.end(); ++i) |
| 2437 | { |
| 2438 | if ((*i) == draggingItem) continue; |
| 2439 | weight += (*i)->getRules()->getWeight(); |
| 2440 | if ((*i)->getAmmoItem() != (*i) && (*i)->getAmmoItem()) weight += (*i)->getAmmoItem()->getRules()->getWeight(); |
| 2441 | } |
| 2442 | return std::max(0,weight); |
| 2443 | } |
| 2444 | |
| 2445 | /** |
| 2446 | * Set how long since this unit was last exposed. |
no test coverage detected