7 override void CreateConditionComponents()
15 override typename GetInputType()
20 override bool CanBePerformedFromInventory()
34 if (!
GetGame().IsDedicatedServer())
38 if ( target.IsProxy() )
40 target_entity =
EntityAI.Cast( target.GetParent() );
44 target_entity =
EntityAI.Cast( target.GetObject() );
51 if ( super.SetupAction( player, target, item, action_data, extra_data))
53 if (!
GetGame().IsDedicatedServer())
56 action_data_a.m_AttSlot = il.GetSlot();
67 if( !item.CanSwitchDuringAttach(target_entity) )
70 if ( target_entity && item )
72 if ( target_entity.GetInventory() && target_entity.GetInventory().CanAddAttachment( item ) )
80 override void OnExecuteServer(
ActionData action_data )
89 if ( action_data.m_Target.IsProxy() )
91 target_EAI =
EntityAI.Cast( action_data_a.m_Target.GetParent() );
95 target_EAI =
EntityAI.Cast( action_data_a.m_Target.GetObject() );
98 if (target_EAI && action_data_a.m_MainItem)
101 il.SetAttachment( target_EAI, action_data.m_MainItem, action_data_a.m_AttSlot );
102 action_data.m_Player.PredictiveForceSwapEntities( target_EAI, action_data.m_MainItem, il );
106 override void OnExecuteClient(
ActionData action_data )
113 if ( action_data.m_Target.IsProxy() )
115 target_EAI =
EntityAI.Cast( action_data_a.m_Target.GetParent() );
119 target_EAI =
EntityAI.Cast( action_data_a.m_Target.GetObject() );
122 if (target_EAI && action_data_a.m_MainItem)
125 il.SetAttachment( target_EAI, action_data.m_MainItem, action_data_a.m_AttSlot );
126 action_data.m_Player.PredictiveForceSwapEntities( target_EAI, action_data.m_MainItem, il );