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

◆ EEItemAttached()

void Entity::EEItemAttached ( EntityAI item,
string slot_name )
inlineprotected

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

1134 {
1135 int slotId = InventorySlots.GetSlotIdFromString(slot_name);
1136 PropagateExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId), slotId); //Performed from parent to avoid event order issues on swap
1138
1139 Man player = GetHierarchyRootPlayer();
1140 if (player)
1141 player.GetCachedEquipment().OnItemAttached(item, slotId, this);
1142
1143 if ( m_ComponentsBank != NULL )
1144 {
1145 for ( int comp_key = 0; comp_key < COMP_TYPE_COUNT; ++comp_key )
1146 {
1147 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
1148 {
1149 m_ComponentsBank.GetComponent(comp_key).Event_OnItemAttached(item, slot_name);
1150 }
1151 }
1152 }
1153
1154 // Energy Manager
1155 if ( m_EM && item.GetCompEM())
1156 m_EM.OnAttachmentAdded(item);
1157
1158 GameInventory itemInventory = item.GetInventory();
1159 if ( itemInventory.GetCargo() )
1160 m_AttachmentsWithCargo.Insert( item );
1161
1162 if ( itemInventory.GetAttachmentSlotsCount() > 0 )
1163 m_AttachmentsWithAttachments.Insert( item );
1164
1165 if ( m_OnItemAttached )
1166 m_OnItemAttached.Invoke( item, slot_name, this );
1167 }
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
ref array< EntityAI > m_AttachmentsWithCargo
ref array< EntityAI > m_AttachmentsWithAttachments
ref ComponentsBank m_ComponentsBank
ref ScriptInvoker m_OnItemAttached
ComponentEnergyManager m_EM
void SetWeightDirty()
void PropagateExclusionValueRecursive(set< int > values, int slotId)
proto native int GetAttachmentSlotsCount()
proto native CargoBase GetCargo()
cargo
const int COMP_TYPE_COUNT
Определения Component.c:12

Перекрестные ссылки COMP_TYPE_COUNT, EntityAI(), GameInventory::GetAttachmentSlotsCount(), GameInventory::GetCargo(), GetHierarchyRootPlayer(), InventorySlots::GetSlotIdFromString(), m_AttachmentsWithAttachments, m_AttachmentsWithCargo, m_ComponentsBank, m_EM, m_OnItemAttached, PropagateExclusionValueRecursive() и SetWeightDirty().