Remove IRangedInteract (#6374)
* Remove IRangedInteract Apparently this has been gone for a while anyway. * Also this woops
This commit is contained in:
@@ -273,21 +273,9 @@ namespace Content.Server.Interaction
|
|||||||
{
|
{
|
||||||
var rangedMsg = new RangedInteractEvent(user, used, target.Value, clickLocation);
|
var rangedMsg = new RangedInteractEvent(user, used, target.Value, clickLocation);
|
||||||
RaiseLocalEvent(target.Value, rangedMsg);
|
RaiseLocalEvent(target.Value, rangedMsg);
|
||||||
|
|
||||||
if (rangedMsg.Handled)
|
if (rangedMsg.Handled)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var rangedInteractions = AllComps<IRangedInteract>(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);
|
return await InteractDoAfter(user, used, inRangeUnobstructed ? target : null, clickLocation, false);
|
||||||
|
|||||||
@@ -1,40 +1,9 @@
|
|||||||
using System;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.Analyzers;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
|
||||||
namespace Content.Shared.Interaction
|
namespace Content.Shared.Interaction
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// This interface gives components behavior when being clicked on by a user with an object
|
|
||||||
/// outside the range of direct use
|
|
||||||
/// </summary>
|
|
||||||
[RequiresExplicitImplementation]
|
|
||||||
public interface IRangedInteract
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Called when we try to interact with an entity out of range
|
|
||||||
/// </summary>
|
|
||||||
[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; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raised when an entity is interacted with that is out of the user entity's range of direct use.
|
/// Raised when an entity is interacted with that is out of the user entity's range of direct use.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user