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

◆ OnExecuteImpl()

void ActionAttachToConstruction::OnExecuteImpl ( ActionData action_data)
inlineprotected

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

73 {
74 EntityAI target_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
75 ItemBase item = ItemBase.Cast( action_data.m_MainItem );
76
77 ConstructionActionData construction_action_data = action_data.m_Player.GetConstructionActionData();
78 int slot_id = construction_action_data.GetSlotId();
79
80 if ( slot_id != -1 )
81 {
82 ItemBase attachment = ItemBase.Cast( target_entity.GetInventory().FindAttachment( slot_id ) );
83
84 if ( attachment )
85 {
86 //combine
87 attachment.CombineItemsClient( item );
88 }
89 else// if( target_entity.GetInventory().CanAddAttachmentEx( item, slot_id ) )
90 {
91 ItemBase item_base = ItemBase.Cast( item );
92 float stackable = item_base.GetTargetQuantityMax( slot_id );
93
94 if( stackable == 0 || stackable >= item_base.GetQuantity() )
95 {
96 action_data.m_Player.PredictiveTakeEntityToTargetAttachmentEx(target_entity, item, slot_id);
97 }
98 else if( stackable != 0 && stackable < item_base.GetQuantity() )
99 {
100 item_base.SplitIntoStackMaxClient( target_entity, slot_id );
101 }
102 }
103 }
104 }
class LogManager EntityAI
class GP5GasMask extends MaskBase ItemBase

Перекрестные ссылки ActionData и ConstructionActionData::GetSlotId().

Используется в OnExecuteClient() и OnExecuteServer().