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

◆ GetInventoryAndCargoWeight()

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

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

3622 {
3623 GameInventory inventory = GetInventory();
3624 float totalWeight;
3625 if (inventory)
3626 {
3627 int i = 0;
3628 int AttachmentsCount = inventory.AttachmentCount();
3629 for (i = 0; i < AttachmentsCount; ++i)
3630 {
3631 totalWeight += inventory.GetAttachmentFromIndex(i).GetWeightEx(forceRecalc);
3632 }
3633
3634 CargoBase cargo = inventory.GetCargo();
3635 if (cargo)
3636 {
3637 int cargoCount = cargo.GetItemCount();
3638 for (i = 0; i < cargoCount; ++i)
3639 {
3640 totalWeight += cargo.GetItem(i).GetWeightEx(forceRecalc);
3641 }
3642 }
3643 }
3644 return totalWeight;
3645 }
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().