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

◆ SetInvisibleRecursive()

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

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

4061 {
4062 array<int> childrenAtt = new array<int>;
4063 array<int> attachmentsArray = new array<int>;
4064 if (attachments)
4065 attachmentsArray.Copy(attachments);
4066 else
4067 {
4068 GameInventory inventory = GetInventory();
4069 int nAttachmentSlots = inventory.GetAttachmentSlotsCount();
4070 for (int i = 0; i < nAttachmentSlots; ++i)
4071 {
4072 attachmentsArray.Insert(inventory.GetAttachmentSlotId(i));
4073 }
4074 }
4075
4076 EntityAI item;
4077
4078 GameInventory parentInventory;
4079 if (parent)
4080 parentInventory = parent.GetInventory();
4081
4082 foreach( int slot : attachmentsArray )
4083 {
4084 if( parentInventory )
4085 item = parentInventory.FindAttachment(slot);
4086 else
4087 item = this;//GetInventory().FindAttachment(slot);
4088
4089 if( item )
4090 {
4091 GameInventory itemInventory = item.GetInventory();
4092 int nAttachment = itemInventory.AttachmentCount();
4093 if( nAttachment > 0 )
4094 {
4095 int nAttachmentSlots2 = itemInventory.GetAttachmentSlotsCount();
4096 for(i = 0; i < nAttachmentSlots2; ++i)
4097 {
4098 childrenAtt.Insert(itemInventory.GetAttachmentSlotId(i));
4099 }
4100
4101 SetInvisibleRecursive(invisible,item,childrenAtt);
4102 }
4103
4104 item.SetInvisible(invisible);
4105 item.OnInvisibleSet(invisible);
4106 }
4107 }
4108 }
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().