9 override void CreateConditionComponents()
17 if (player.IsPlacingLocal())
23 if (targetIB && targetIB.GetHierarchyRoot() == targetIB && item)
25 if (item.HasEnergyManager() && !item.GetCompEM().IsPlugged() && targetIB.HasEnergyManager() && targetIB.GetCompEM().CanReceivePlugFrom(item))
30 ItemBase attachedDevice = GetAttachedDevice(targetIB);
34 return attachedDevice.GetCompEM().HasFreeSocket();
41 override void OnExecuteServer(ActionData action_data)
45 if (targetIB.HasEnergyManager())
47 ItemBase attachedDevice = GetAttachedDevice(targetIB);
49 targetIB = attachedDevice;
51 action_data.m_MainItem.GetCompEM().PlugThisInto(targetIB);
53 if (!
g_Game.IsDedicatedServer())
55 if (!action_data.m_Player.IsPlacingLocal())
57 action_data.m_Player.PlacingStartLocal(action_data.m_MainItem);
63 if (!action_data.m_Player.IsPlacingServer())
65 action_data.m_Player.PlacingStartServer(action_data.m_MainItem);
72 void Process(ActionData action_data)
76 targetIB.GetInventory().TakeEntityAsAttachment(
InventoryMode.LOCAL, action_data.m_MainItem);
79 override void OnExecuteClient(ActionData action_data)
81 if (!action_data.m_Player.IsPlacingLocal())
82 action_data.m_Player.PlacingStartLocal(action_data.m_MainItem);
91 ItemBase parentAttachment =
ItemBase.Cast(parent.GetAttachmentByType(MetalWire));
92 if (!parentAttachment)
93 parentAttachment =
ItemBase.Cast(parent.GetAttachmentByType(BarbedWire));
95 return parentAttachment;