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

◆ EEItemAttached()

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

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

1160 {
1161 int slotId = InventorySlots.GetSlotIdFromString(slot_name);
1162 PropagateExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId), slotId); //Performed from parent to avoid event order issues on swap
1164
1165 Man player = GetHierarchyRootPlayer();
1166 if (player)
1167 player.GetCachedEquipment().OnItemAttached(item, slotId, this);
1168
1169 if ( m_ComponentsBank != NULL )
1170 {
1171 for ( int comp_key = 0; comp_key < COMP_TYPE_COUNT; ++comp_key )
1172 {
1173 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
1174 {
1175 m_ComponentsBank.GetComponent(comp_key).Event_OnItemAttached(item, slot_name);
1176 }
1177 }
1178 }
1179
1180 // Energy Manager
1181 if ( m_EM && item.GetCompEM())
1182 m_EM.OnAttachmentAdded(item);
1183
1184 GameInventory itemInventory = item.GetInventory();
1185 if ( itemInventory.GetCargo() )
1186 m_AttachmentsWithCargo.Insert( item );
1187
1188 if ( itemInventory.GetAttachmentSlotsCount() > 0 )
1189 m_AttachmentsWithAttachments.Insert( item );
1190
1191 if ( m_OnItemAttached )
1192 m_OnItemAttached.Invoke( item, slot_name, this );
1193 }
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().