DayZ 1.29
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 строка 4655

4656 {
4657 EntityAI currentAtt = GetInventory().FindAttachment(slotId);
4658 bool hasInternalConflict = attachment.HasInternalExclusionConflicts(slotId);
4659 set<int> diff;
4660 InventoryLocation curLoc = new InventoryLocation();
4661 if (currentAtt) //probably a swap or same-type swap
4662 {
4663 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4664 diff.RemoveItems(currentAtt.GetAttachmentExclusionMaskAll(slotId));
4665 if (diff.Count() == 0)
4666 {
4667 return !hasInternalConflict;
4668 }
4669 else
4670 {
4671 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4672 }
4673 }
4674 else if (attachment.GetInventory().GetCurrentInventoryLocation(curLoc) && curLoc.GetType() == InventoryLocationType.ATTACHMENT)
4675 {
4676 EntityAI rootOwner = attachment.GetHierarchyRoot();
4677 if (rootOwner && rootOwner == this.GetHierarchyRoot()) //attachment within the same exclusion hierarchy context
4678 {
4679 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4680 diff.RemoveItems(attachment.GetAttachmentExclusionMaskAll(curLoc.GetSlot()));
4681 if (diff.Count() == 0)
4682 {
4683 return !hasInternalConflict;
4684 }
4685 else
4686 {
4687 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4688 }
4689 }
4690 }
4691 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(attachment.GetAttachmentExclusionMaskAll(slotId),slotId);
4692 }
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().