diff --git a/Content.Server/Mech/Systems/MechSystem.cs b/Content.Server/Mech/Systems/MechSystem.cs index ab307673c6..cf41335f35 100644 --- a/Content.Server/Mech/Systems/MechSystem.cs +++ b/Content.Server/Mech/Systems/MechSystem.cs @@ -195,7 +195,7 @@ public sealed class MechSystem : SharedMechSystem Priority = 1, // Promote to top to make ejecting the ALT-click action Act = () => { - if (args.User == component.PilotSlot.ContainedEntity) + if (args.User == uid || args.User == component.PilotSlot.ContainedEntity) { TryEject(uid, component); return; diff --git a/Content.Shared/Interaction/Components/InteractionRelayComponent.cs b/Content.Shared/Interaction/Components/InteractionRelayComponent.cs index bd8bdf3b88..9ae63c3527 100644 --- a/Content.Shared/Interaction/Components/InteractionRelayComponent.cs +++ b/Content.Shared/Interaction/Components/InteractionRelayComponent.cs @@ -7,6 +7,8 @@ namespace Content.Shared.Interaction.Components; /// Relays an entities interactions to another entity. /// This doesn't raise the same events, but just relays /// the clicks of the mouse. +/// +/// Note that extreme caution should be taken when using this, as this will probably bypass many normal can-interact checks. /// [RegisterComponent, NetworkedComponent] [Access(typeof(SharedInteractionSystem))] diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 8314d36b12..c3fbb299ab 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -240,7 +240,12 @@ namespace Content.Shared.Interaction { if (TryComp(user, out var relay) && relay.RelayEntity is not null) { - UserInteraction(relay.RelayEntity.Value, coordinates, target, altInteract, checkCanInteract, checkAccess, checkCanUse); + // TODO this needs to be handled better. This probably bypasses many complex can-interact checks in weird roundabout ways. + if (_actionBlockerSystem.CanInteract(user, target)) + { + UserInteraction(relay.RelayEntity.Value, coordinates, target, altInteract, checkCanInteract, checkAccess, checkCanUse); + return; + } } if (target != null && Deleted(target.Value)) diff --git a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs index 114e7f9620..70e8405240 100644 --- a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs +++ b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs @@ -125,6 +125,7 @@ public abstract class SharedMechSystem : EntitySystem if (pilot == null) return; + // TODO why is this being blocked? if (!_timing.IsFirstTimePredicted) return; @@ -165,6 +166,8 @@ public abstract class SharedMechSystem : EntitySystem var rider = EnsureComp(pilot); var relay = EnsureComp(pilot); + + // Warning: this bypasses most normal interaction blocking components on the user, like drone laws and the like. var irelay = EnsureComp(pilot); _mover.SetRelay(pilot, mech, relay);