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

◆ CheckAttachmentReceiveExclusion()

bool Entity::CheckAttachmentReceiveExclusion ( EntityAI attachment,
int slotId )
inlineprotected

checks specifically for att. exclusion conflicts before att. receive

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

4723 {
4724 EntityAI currentAtt = GetInventory().FindAttachment(slotId);
4725 bool hasInternalConflict = attachment.HasInternalExclusionConflicts(slotId);
4726 set<int> diff;
4727 InventoryLocation curLoc = new InventoryLocation();
4728 if (currentAtt) //probably a swap or same-type swap
4729 {
4730 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4731 diff.RemoveItems(currentAtt.GetAttachmentExclusionMaskAll(slotId));
4732 if (diff.Count() == 0)
4733 {
4734 return !hasInternalConflict;
4735 }
4736 else
4737 {
4738 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4739 }
4740 }
4741 else if (attachment.GetInventory().GetCurrentInventoryLocation(curLoc) && curLoc.GetType() == InventoryLocationType.ATTACHMENT)
4742 {
4743 EntityAI rootOwner = attachment.GetHierarchyRoot();
4744 if (rootOwner && rootOwner == this.GetHierarchyRoot()) //attachment within the same exclusion hierarchy context
4745 {
4746 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4747 diff.RemoveItems(attachment.GetAttachmentExclusionMaskAll(curLoc.GetSlot()));
4748 if (diff.Count() == 0)
4749 {
4750 return !hasInternalConflict;
4751 }
4752 else
4753 {
4754 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4755 }
4756 }
4757 }
4758 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(attachment.GetAttachmentExclusionMaskAll(slotId),slotId);
4759 }
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
proto native GameInventory GetInventory()
void EntityAI()
cache blood infection chance (cfgVehicles-><entity>->Skinning->BloodInfectionSettings)
proto native EntityAI GetHierarchyRoot()
Returns root of current hierarchy (for example: if this entity is in Backpack on gnd,...
bool IsExclusionFlagPresentRecursive(set< int > values, int targetSlot)
Gets flag from what is effectively an owner.
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation

Перекрестные ссылки EntityAI(), GetHierarchyRoot(), GetInventory(), InventoryLocation::GetSlot(), InventoryLocation::GetType() и IsExclusionFlagPresentRecursive().

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