From 97a343e9c594ff7e78fc0a74db24d6e8c77fb972 Mon Sep 17 00:00:00 2001 From: CrimeMoot Date: Thu, 2 Jan 2025 12:37:26 +0500 Subject: [PATCH] fix --- .../TurretControl/Components/TurretControllerComponent.cs | 8 +++++++- Content.Shared/_Cats/TurretControl/TurretControlSystem.cs | 6 +++++- Resources/Prototypes/Entities/Mobs/Player/silicon.yml | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Content.Shared/_Cats/TurretControl/Components/TurretControllerComponent.cs b/Content.Shared/_Cats/TurretControl/Components/TurretControllerComponent.cs index 0bdc0a551d..9e2befa9be 100644 --- a/Content.Shared/_Cats/TurretControl/Components/TurretControllerComponent.cs +++ b/Content.Shared/_Cats/TurretControl/Components/TurretControllerComponent.cs @@ -1,4 +1,10 @@ +using Robust.Shared.Prototypes; + namespace Content.Shared._Cats.TurretControl.Components; [RegisterComponent] -public sealed partial class TurretControllerComponent : Component; \ No newline at end of file +public sealed partial class TurretControllerComponent : Component +{ + [DataField] + public ComponentRegistry RequiredComponents = []; +} \ No newline at end of file diff --git a/Content.Shared/_Cats/TurretControl/TurretControlSystem.cs b/Content.Shared/_Cats/TurretControl/TurretControlSystem.cs index 2263960bb9..fc917e00ba 100644 --- a/Content.Shared/_Cats/TurretControl/TurretControlSystem.cs +++ b/Content.Shared/_Cats/TurretControl/TurretControlSystem.cs @@ -26,9 +26,13 @@ public override void Initialize() private void OnGetVerbs(Entity entity, ref GetVerbsEvent e) { - if (!HasComp(e.User)) + if (!TryComp(e.User, out var controller)) return; + foreach (var component in controller.RequiredComponents) + if (!HasComp(e.User, component.Value.Component.GetType())) + return; + if (!TryComp(entity, out var factionMember)) return; diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index 5c4e0bdef9..01a1597a7e 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -437,6 +437,8 @@ speechVerb: Robotic speechSounds: Borg - type: TurretController # Cats-TurretControl + requiredComponents: + - type: StationAiHeld - type: Tag tags: - HideContextMenu