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

◆ SetInvisibleRecursive()

void Entity::SetInvisibleRecursive ( bool invisible,
EntityAI parent = null,
array< int > attachments = null )
inlineprotected

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

4013 {
4014 array<int> childrenAtt = new array<int>;
4015 array<int> attachmentsArray = new array<int>;
4016 if (attachments)
4017 attachmentsArray.Copy(attachments);
4018 else
4019 {
4020 GameInventory inventory = GetInventory();
4021 int nAttachmentSlots = inventory.GetAttachmentSlotsCount();
4022 for (int i = 0; i < nAttachmentSlots; ++i)
4023 {
4024 attachmentsArray.Insert(inventory.GetAttachmentSlotId(i));
4025 }
4026 }
4027
4028 EntityAI item;
4029
4030 GameInventory parentInventory;
4031 if (parent)
4032 parentInventory = parent.GetInventory();
4033
4034 foreach( int slot : attachmentsArray )
4035 {
4036 if( parentInventory )
4037 item = parentInventory.FindAttachment(slot);
4038 else
4039 item = this;//GetInventory().FindAttachment(slot);
4040
4041 if( item )
4042 {
4043 GameInventory itemInventory = item.GetInventory();
4044 int nAttachment = itemInventory.AttachmentCount();
4045 if( nAttachment > 0 )
4046 {
4047 int nAttachmentSlots2 = itemInventory.GetAttachmentSlotsCount();
4048 for(i = 0; i < nAttachmentSlots2; ++i)
4049 {
4050 childrenAtt.Insert(itemInventory.GetAttachmentSlotId(i));
4051 }
4052
4053 SetInvisibleRecursive(invisible,item,childrenAtt);
4054 }
4055
4056 item.SetInvisible(invisible);
4057 item.OnInvisibleSet(invisible);
4058 }
4059 }
4060 }
proto native GameInventory GetInventory()
void EntityAI()
cache blood infection chance (cfgVehicles-><entity>->Skinning->BloodInfectionSettings)
void SetInvisibleRecursive(bool invisible, EntityAI parent=null, array< int > attachments=null)
proto native int GetAttachmentSlotsCount()
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto native int GetAttachmentSlotId(int index)
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)

Перекрестные ссылки GameInventory::AttachmentCount(), EntityAI(), GameInventory::FindAttachment(), GameInventory::GetAttachmentSlotId(), GameInventory::GetAttachmentSlotsCount(), GetInventory() и SetInvisibleRecursive().

Используется в OnWasDetached() и SetInvisibleRecursive().