DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetInventoryAndCargoWeight()

float Entity::GetInventoryAndCargoWeight ( bool forceRecalc = false)
inlineprotected

См. определение в файле EntityAI.c строка 3533

3534 {
3535 float totalWeight;
3536 if (GetInventory())
3537 {
3538 int i = 0;
3539 int AttachmentsCount = GetInventory().AttachmentCount();
3540 if (AttachmentsCount > 0)
3541 {
3542 for (i = 0; i < AttachmentsCount; i++)
3543 {
3544 totalWeight += GetInventory().GetAttachmentFromIndex(i).GetWeightEx(forceRecalc);
3545 }
3546 }
3547
3548 CargoBase cargo = GetInventory().GetCargo();
3549 if (cargo)
3550 {
3551 int cargoCount = cargo.GetItemCount();
3552 for (i = 0; i < cargoCount; i++)
3553 {
3554 totalWeight += cargo.GetItem(i).GetWeightEx(forceRecalc);
3555 }
3556 }
3557 }
3558 return totalWeight;
3559 }
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
proto native GameInventory GetInventory()
proto native EntityAI GetAttachmentFromIndex(int index)
proto native CargoBase GetCargo()
cargo
proto native int AttachmentCount()
Returns count of attachments attached to this item.

Перекрестные ссылки GetInventory(), CargoBase::GetItem() и CargoBase::GetItemCount().

Используется в GetWeightSpecialized().