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

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = null )

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

29 {
31 if (!GetGame().IsDedicatedServer())
32 {
33 EntityAI targetEntity;
34 if (target.IsProxy())
35 {
36 targetEntity = EntityAI.Cast(target.GetParent());
37 }
38 else
39 {
40 targetEntity = EntityAI.Cast(target.GetObject());
41 }
42
43 if (!targetEntity.GetInventory().FindFreeLocationFor(item, FindInventoryLocationType.ATTACHMENT, il))
44 return false;
45 }
46
47 if (super.SetupAction(player, target, item, action_data, extra_data))
48 {
49 #ifndef SERVER
50 AttachActionData action_data_a = AttachActionData.Cast(action_data);
51 action_data_a.m_AttSlot = il.GetSlot();
52 #endif
53
54 return true;
55 }
56
57 return false;
58 }
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
int m_AttSlot
Определения ActionAttach.c:3
Определения ActionAttach.c:2
Определения Building.c:6
proto native int GetSlot()
returns slot id if current type is Attachment
InventoryLocation.
Определения InventoryLocation.c:29
proto native CGame GetGame()

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