RangedInteractEvent uses EntityUid exclusively

Did anyone else know this event was a thing?
This commit is contained in:
Vera Aguilera Puerto
2021-11-09 15:05:04 +01:00
parent 22724d06b4
commit 4f215c7b45
2 changed files with 8 additions and 23 deletions

View File

@@ -403,7 +403,7 @@ namespace Content.Server.Interaction
if (target != null)
{
var rangedMsg = new RangedInteractEvent(user, used, target, clickLocation);
var rangedMsg = new RangedInteractEvent(user.Uid, used.Uid, target.Uid, clickLocation);
RaiseLocalEvent(target.Uid, rangedMsg);
if (rangedMsg.Handled)
return true;

View File

@@ -44,43 +44,28 @@ namespace Content.Shared.Interaction
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public EntityUid UserUid => User.Uid;
public EntityUid UserUid { get; }
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public IEntity Used { get; }
/// <summary>
/// Entity that the user used to interact.
/// </summary>
public EntityUid UsedUid => Used.Uid;
public EntityUid UsedUid { get; }
/// <summary>
/// Entity that was interacted on.
/// </summary>
public IEntity Target { get; }
/// <summary>
/// Entity that was interacted on.
/// </summary>
public EntityUid TargetUid => Target.Uid;
public EntityUid TargetUid { get; }
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>
public EntityCoordinates ClickLocation { get; }
public RangedInteractEvent(IEntity user, IEntity used, IEntity target, EntityCoordinates clickLocation)
public RangedInteractEvent(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation)
{
User = user;
Used = used;
Target = target;
UserUid = user;
UsedUid = used;
TargetUid = target;
ClickLocation = clickLocation;
}
}