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 (!action_data.m_Player.IsPlacingServer())
55 action_data.m_Player.PlacingStartServer(action_data.m_MainItem);
66 targetIB.GetInventory().TakeEntityAsAttachment(
InventoryMode.LOCAL, action_data.m_MainItem);
69 override void OnExecuteClient(
ActionData action_data)
71 if (!action_data.m_Player.IsPlacingLocal())
72 action_data.m_Player.TogglePlacingLocal();
81 ItemBase parentAttachment =
ItemBase.Cast(parent.GetAttachmentByType(MetalWire));
82 if (!parentAttachment)
83 parentAttachment =
ItemBase.Cast(parent.GetAttachmentByType(BarbedWire));
85 return parentAttachment;