From ee179762fd7b47fc7b5ec4a9dd23a7f2135e5678 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 30 Jan 2022 03:58:59 +1100 Subject: [PATCH] Remove IRangedInteract (#6374) * Remove IRangedInteract Apparently this has been gone for a while anyway. * Also this woops --- .../Interaction/InteractionSystem.cs | 14 +-------- Content.Shared/Interaction/IRangedInteract.cs | 31 ------------------- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/Content.Server/Interaction/InteractionSystem.cs b/Content.Server/Interaction/InteractionSystem.cs index 1a01c2a85d..d39618d0e5 100644 --- a/Content.Server/Interaction/InteractionSystem.cs +++ b/Content.Server/Interaction/InteractionSystem.cs @@ -273,21 +273,9 @@ namespace Content.Server.Interaction { var rangedMsg = new RangedInteractEvent(user, used, target.Value, clickLocation); RaiseLocalEvent(target.Value, rangedMsg); + if (rangedMsg.Handled) return true; - - var rangedInteractions = AllComps(target.Value).ToList(); - var rangedInteractionEventArgs = new RangedInteractEventArgs(user, used, clickLocation); - - // See if we have a ranged interaction - foreach (var t in rangedInteractions) - { - // If an InteractUsingRanged returns a status completion we finish our interaction -#pragma warning disable 618 - if (t.RangedInteract(rangedInteractionEventArgs)) -#pragma warning restore 618 - return true; - } } return await InteractDoAfter(user, used, inRangeUnobstructed ? target : null, clickLocation, false); diff --git a/Content.Shared/Interaction/IRangedInteract.cs b/Content.Shared/Interaction/IRangedInteract.cs index c878b1dcd0..b9b71e7156 100644 --- a/Content.Shared/Interaction/IRangedInteract.cs +++ b/Content.Shared/Interaction/IRangedInteract.cs @@ -1,40 +1,9 @@ -using System; using JetBrains.Annotations; -using Robust.Shared.Analyzers; using Robust.Shared.GameObjects; using Robust.Shared.Map; namespace Content.Shared.Interaction { - /// - /// This interface gives components behavior when being clicked on by a user with an object - /// outside the range of direct use - /// - [RequiresExplicitImplementation] - public interface IRangedInteract - { - /// - /// Called when we try to interact with an entity out of range - /// - [Obsolete("Use RangedInteractMessage instead")] - bool RangedInteract(RangedInteractEventArgs eventArgs); - } - - [PublicAPI] - public class RangedInteractEventArgs : EventArgs - { - public RangedInteractEventArgs(EntityUid user, EntityUid @using, EntityCoordinates clickLocation) - { - User = user; - Using = @using; - ClickLocation = clickLocation; - } - - public EntityUid User { get; } - public EntityUid Using { get; } - public EntityCoordinates ClickLocation { get; } - } - /// /// Raised when an entity is interacted with that is out of the user entity's range of direct use. ///