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

◆ GetAttachmentsFromSelection()

void ConstructionActionData::GetAttachmentsFromSelection ( EntityAI target,
string selection,
out array< EntityAI > attachments )
inlineprotected

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

500 {
501 attachments.Clear(); //clear output
502 TypeAttachmentGroupsDataHolder holder = target.GetTypeAttachmentGroupInfoHolder();
503 array<TypeAttachmentGroupData> dataArray = holder.GetAttGroupsDataBySelectionParam(selection);
504 foreach (TypeAttachmentGroupData data : dataArray)
505 {
506 if (data)
507 {
508 int slotId;
509 EntityAI attachment;
510 GameInventory inventory = target.GetInventory();
511 foreach (string slotName : data.m_AttSlots)
512 {
513 slotId = InventorySlots.GetSlotIdFromString(slotName);
514 attachment = inventory.FindAttachment(slotId);
515 if (attachment && inventory.CanRemoveAttachmentEx(attachment, slotId) && !inventory.GetSlotLock(slotId))
516 {
517 attachments.Insert(attachment);
518 }
519 }
520 }
521 }
522 }
class LogManager EntityAI
PlayerSpawnPreset slotName
proto native bool CanRemoveAttachmentEx(EntityAI attachment, int slot)
proto native bool GetSlotLock(int slot)
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
array< TypeAttachmentGroupData > GetAttGroupsDataBySelectionParam(string selectionName)
Returns an array of 'GUIInventoryAttachmentsProps' subclasses that use the same 'selection'.

Перекрестные ссылки GameInventory::CanRemoveAttachmentEx(), GameInventory::FindAttachment(), TypeAttachmentGroupsDataHolder::GetAttGroupsDataBySelectionParam(), InventorySlots::GetSlotIdFromString(), GameInventory::GetSlotLock() и slotName.

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