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

◆ FindSlotIdToDetach()

override int FindSlotIdToDetach ( PlayerBase player,
ActionTarget target,
ItemBase item )

См. определение в файле ActionDetachFromTarget.c строка 138

139 {
140 EntityAI target_entity = EntityAI.Cast(target.GetObject());
141
142 if ( player && target_entity )
143 {
144 array<string> selections = new array<string>();
145 target_entity.GetActionComponentNameList( target.GetComponentIndex(),selections );
146
147 if ( target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0 )
148 {
149 for(int i = 0; i < selections.Count(); i++ )
150 {
151 if( selections[i] == m_slotToDetach )
152 {
153 int target_slot_id = InventorySlots.GetSlotIdFromString( selections[i] );
154 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
155
156 if ( att && player.GetInventory().CanAddEntityIntoHands(att) )
157 {
158 if ( att.CanDetachAttachment( target_entity ) && target_entity.CanReleaseAttachment( att ) )
159 return target_slot_id;
160 }
161 }
162 }
163 }
164 }
165 return InventorySlots.INVALID;
166 }
ActionDetachFromTarget m_slotToDetach
Определения Building.c:6
const int INVALID
Invalid slot (-1)
Определения InventorySlots.c:17
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
Определения InventorySlots.c:6
Result for an object found in CGame.IsBoxCollidingGeometryProxy.