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

◆ OnExecute()

override void ActionTakeHybridAttachment::OnExecute ( ActionData action_data)
inlineprivate

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

88 {
89 if (GetGame().IsDedicatedServer())
90 {
91 ClearActionJuncture(action_data);
92 return;
93 }
94
95 //Debug.Log("[Action DEBUG] Start time stamp: " + action_data.m_Player.GetSimulationTimeStamp());
96 EntityAI tgt_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
97 string component_name = tgt_entity.GetActionComponentName( action_data.m_Target.GetComponentIndex() );
98 ItemBase attachment;
99
100 if ( tgt_entity && ItemBase.CastTo(attachment, tgt_entity.FindAttachmentBySlotName(component_name)) )
101 {
102 InventoryLocation il = action_data.m_ReservedInventoryLocations.Get(0);
103 InventoryLocation targetInventoryLocation = new InventoryLocation;
104 attachment.GetInventory().GetCurrentInventoryLocation(targetInventoryLocation);
105 ClearInventoryReservationEx(action_data);
106 //SplitItemUtils.TakeOrSplitToInventoryLocation( action_data.m_Player, il );
107
108 float stackable = attachment.GetTargetQuantityMax(il.GetSlot());
109
110 if( stackable == 0 || stackable >= attachment.GetQuantity() )
111 {
112 action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
113 }
114 else
115 {
116 attachment.SplitIntoStackMaxToInventoryLocationClient( il );
117 }
118 }
119 //action_data.m_Player.PredictiveTakeToDst(targetInventoryLocation, il);
120 }
class LogManager EntityAI
class GP5GasMask extends MaskBase ItemBase
void ClearActionJuncture(ActionData action_data)
Определения ActionBase.c:1083
void ClearInventoryReservationEx(ActionData action_data)
Определения ActionBase.c:1025
proto native int GetSlot()
returns slot id if current type is Attachment
proto native CGame GetGame()

Перекрестные ссылки ActionData, ActionBase::ClearActionJuncture(), ActionBase::ClearInventoryReservationEx(), GetGame() и InventoryLocation::GetSlot().