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

◆ GetInventoryAndCargoWeight()

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

См. определение в файле 3_Game/DayZ/Entities/EntityAI.c строка 3580

3581 {
3582 GameInventory inventory = GetInventory();
3583 float totalWeight;
3584 if (inventory)
3585 {
3586 int i = 0;
3587 int AttachmentsCount = inventory.AttachmentCount();
3588 for (i = 0; i < AttachmentsCount; ++i)
3589 {
3590 totalWeight += inventory.GetAttachmentFromIndex(i).GetWeightEx(forceRecalc);
3591 }
3592
3593 CargoBase cargo = inventory.GetCargo();
3594 if (cargo)
3595 {
3596 int cargoCount = cargo.GetItemCount();
3597 for (i = 0; i < cargoCount; ++i)
3598 {
3599 totalWeight += cargo.GetItem(i).GetWeightEx(forceRecalc);
3600 }
3601 }
3602 }
3603 return totalWeight;
3604 }
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.

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

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