DayZ 1.24
Loading...
Searching...
No Matches
ActionDetachFromTarget_SpecificSlotsCategory Class Reference
Inheritance diagram for ActionDetachFromTarget_SpecificSlotsCategory:
[legend]
Collaboration diagram for ActionDetachFromTarget_SpecificSlotsCategory:
[legend]

Private Member Functions

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

Private Attributes

string m_slotsToDetach
 

Detailed Description

Definition at line 165 of file ActionDetachFromTarget.c.

Member Function Documentation

◆ FindSlotIdToDetach()

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

Definition at line 169 of file ActionDetachFromTarget.c.

170 {
171 EntityAI target_entity = EntityAI.Cast(target.GetObject());
172
173 if (player && target_entity)
174 {
176 target_entity.GetActionComponentNameList(target.GetComponentIndex(), selections);
177
178 if (target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0)
179 {
180 for (int i = 0; i < selections.Count(); i++)
181 {
182 if (selections[i].Contains(m_slotsToDetach))
183 {
185 EntityAI att = target_entity.GetInventory().FindAttachment(target_slot_id);
186
187 if (att && player.GetInventory().CanAddEntityIntoHands(att))
188 {
189 if (att.CanDetachAttachment(target_entity) && target_entity.CanReleaseAttachment(att))
190 return target_slot_id;
191 }
192 }
193 }
194 }
195 }
196 return InventorySlots.INVALID;
197 }
provides access to slot configuration
const int INVALID
Invalid slot (-1)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

References InventorySlots::GetSlotIdFromString(), InventorySlots::INVALID, and m_slotsToDetach.

Member Data Documentation

◆ m_slotsToDetach

string ActionDetachFromTarget_SpecificSlotsCategory::m_slotsToDetach
private

The documentation for this class was generated from the following file: