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

◆ SetupAction()

override bool ActionAttachWithSwitch::SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate

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

32 {
33 ref InventoryLocation il = new InventoryLocation;
34 if (!GetGame().IsDedicatedServer())
35 {
36 EntityAI target_entity;
37
38 if ( target.IsProxy() )
39 {
40 target_entity = EntityAI.Cast( target.GetParent() );
41 }
42 else
43 {
44 target_entity = EntityAI.Cast( target.GetObject() );
45 }
46
47 if (!target_entity.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.ATTACHMENT, il ))
48 return false;
49 }
50
51 if ( super.SetupAction( player, target, item, action_data, extra_data))
52 {
53 if (!GetGame().IsDedicatedServer())
54 {
55 AttachActionData action_data_a = AttachActionData.Cast(action_data);
56 action_data_a.m_AttSlot = il.GetSlot();
57 }
58 return true;
59 }
60 return false;
61 }
class LogManager EntityAI
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
int m_AttSlot
Определения ActionAttach.c:3
proto native CGame GetGame()

Перекрестные ссылки ActionData, ActionTarget, GetGame() и AttachActionData::m_AttSlot.