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

◆ GetInventoryAndCargoWeight()

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

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

3536 {
3537 float totalWeight;
3538 if (GetInventory())
3539 {
3540 int i = 0;
3541 int AttachmentsCount = GetInventory().AttachmentCount();
3542 if (AttachmentsCount > 0)
3543 {
3544 for (i = 0; i < AttachmentsCount; i++)
3545 {
3546 totalWeight += GetInventory().GetAttachmentFromIndex(i).GetWeightEx(forceRecalc);
3547 }
3548 }
3549
3550 CargoBase cargo = GetInventory().GetCargo();
3551 if (cargo)
3552 {
3553 int cargoCount = cargo.GetItemCount();
3554 for (i = 0; i < cargoCount; i++)
3555 {
3556 totalWeight += cargo.GetItem(i).GetWeightEx(forceRecalc);
3557 }
3558 }
3559 }
3560 return totalWeight;
3561 }
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().