Fix mech double interactions (#14672)

This commit is contained in:
Leon Friedrich
2023-03-24 14:42:43 +13:00
committed by GitHub
parent b960bc7636
commit 07667ae34b
4 changed files with 12 additions and 2 deletions

View File

@@ -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.
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedInteractionSystem))]

View File

@@ -240,7 +240,12 @@ namespace Content.Shared.Interaction
{
if (TryComp<InteractionRelayComponent>(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))