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

◆ DamageItemAttachments()

bool InventoryItem::DamageItemAttachments ( float damage)
inlineprivate

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

1584 {
1585 GameInventory inventory = GetInventory();
1586 int attachment_count = inventory.AttachmentCount();
1587 if (attachment_count > 0)
1588 {
1589 int random_pick = Math.RandomInt(0, attachment_count);
1590 ItemBase attachment = ItemBase.Cast(inventory.GetAttachmentFromIndex(random_pick));
1591 if (!attachment.IsExplosive())
1592 {
1593 attachment.AddHealth("","",damage);
1594 return true;
1595 }
1596 }
1597 return false;
1598 }
proto native EntityAI GetAttachmentFromIndex(int index)
proto native int AttachmentCount()
Returns count of attachments attached to this item.
void ItemBase()
Определения ItemBase.c:148

Перекрестные ссылки GameInventory::AttachmentCount(), GameInventory::GetAttachmentFromIndex(), ItemBase() и Math::RandomInt().