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

◆ CheckAttachmentReceiveExclusion()

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

checks specifically for att. exclusion conflicts before att. receive

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

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