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

◆ FindSlotIdToDetach()

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

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

174 {
175 EntityAI target_entity = EntityAI.Cast(target.GetObject());
176
177 if ( player && target_entity )
178 {
179 array<string> selections = new array<string>();
180 target_entity.GetActionComponentNameList( target.GetComponentIndex(),selections );
181
182 if ( target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0 )
183 {
184 for(int i = 0; i < selections.Count(); i++ )
185 {
186 if (selections[i].Contains(m_slotsToDetach))
187 {
188 int target_slot_id = InventorySlots.GetSlotIdFromString( selections[i] );
189 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
190
191 if ( att && player.GetInventory().CanAddEntityIntoHands(att) )
192 {
193 if ( att.CanDetachAttachment( target_entity ) && target_entity.CanReleaseAttachment( att ) )
194 return target_slot_id;
195 }
196 }
197 }
198 }
199 }
200 return InventorySlots.INVALID;
201 }
class LogManager EntityAI

Перекрестные ссылки ActionTarget, InventorySlots::GetSlotIdFromString(), InventorySlots::INVALID и m_slotsToDetach.