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) 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); RaiseLocalEvent(target.Uid, rangedMsg);
if (rangedMsg.Handled) if (rangedMsg.Handled)
return true; return true;

View File

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