Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimeMoot authored Jan 2, 2025
1 parent 8a51d81 commit 97a343e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
using Robust.Shared.Prototypes;

namespace Content.Shared._Cats.TurretControl.Components;

[RegisterComponent]
public sealed partial class TurretControllerComponent : Component;
public sealed partial class TurretControllerComponent : Component
{
[DataField]
public ComponentRegistry RequiredComponents = [];
}
6 changes: 5 additions & 1 deletion Content.Shared/_Cats/TurretControl/TurretControlSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ public override void Initialize()

private void OnGetVerbs(Entity<TurretControllableComponent> entity, ref GetVerbsEvent<Verb> e)
{
if (!HasComp<TurretControllerComponent>(e.User))
if (!TryComp<TurretControllerComponent>(e.User, out var controller))
return;

foreach (var component in controller.RequiredComponents)
if (!HasComp(e.User, component.Value.Component.GetType()))
return;

if (!TryComp<NpcFactionMemberComponent>(entity, out var factionMember))
return;

Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@
speechVerb: Robotic
speechSounds: Borg
- type: TurretController # Cats-TurretControl
requiredComponents:
- type: StationAiHeld
- type: Tag
tags:
- HideContextMenu
Expand Down

0 comments on commit 97a343e

Please sign in to comment.