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

◆ CanAttachToProxy()

bool ActionAttachOnProxy::CanAttachToProxy ( PlayerBase player,
EntityAI targetEntity,
ItemBase item,
int componentIndex = -1 )
inlineprotected

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

39 {
40 if (targetEntity && item)
41 {
42 GameInventory inventory = targetEntity.GetInventory();
43 InventoryLocation dst = new InventoryLocation();
44 if (inventory && inventory.CanAddAttachment(item) && inventory.FindFreeLocationFor(item, FindInventoryLocationType.ANY_CARGO | FindInventoryLocationType.ATTACHMENT, dst))
45 {
46 return true;
47 }
48 }
49
50 return false;
51 }
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
proto native bool CanAddAttachment(notnull EntityAI e)
Check if attachment can be added to any slot.
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.

Перекрестные ссылки GameInventory::CanAddAttachment() и GameInventory::FindFreeLocationFor().

Используется в ActionCondition() и AttachItem().