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

◆ CheckAttachmentReceiveExclusion()

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

checks specifically for att. exclusion conflicts before att. receive

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

4596 {
4597 EntityAI currentAtt = GetInventory().FindAttachment(slotId);
4598 bool hasInternalConflict = attachment.HasInternalExclusionConflicts(slotId);
4599 set<int> diff;
4600 InventoryLocation curLoc = new InventoryLocation();
4601 if (currentAtt) //probably a swap or same-type swap
4602 {
4603 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4604 diff.RemoveItems(currentAtt.GetAttachmentExclusionMaskAll(slotId));
4605 if (diff.Count() == 0)
4606 {
4607 return !hasInternalConflict;
4608 }
4609 else
4610 {
4611 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4612 }
4613 }
4614 else if (attachment.GetInventory().GetCurrentInventoryLocation(curLoc) && curLoc.GetType() == InventoryLocationType.ATTACHMENT)
4615 {
4616 EntityAI rootOwner = attachment.GetHierarchyRoot();
4617 if (rootOwner && rootOwner == this.GetHierarchyRoot()) //attachment within the same exclusion hierarchy context
4618 {
4619 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4620 diff.RemoveItems(attachment.GetAttachmentExclusionMaskAll(curLoc.GetSlot()));
4621 if (diff.Count() == 0)
4622 {
4623 return !hasInternalConflict;
4624 }
4625 else
4626 {
4627 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
4628 }
4629 }
4630 }
4631 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(attachment.GetAttachmentExclusionMaskAll(slotId),slotId);
4632 }
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
proto native GameInventory GetInventory()
void EntityAI()
cache blood infection chance (cfgVehicles-><entity>->Skinning->BloodInfectionSettings)
Определения EntityAI.c:202
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.
Определения EntityAI.c:4523
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().