From 4f215c7b45d2c062fde54501f1023ca9addc97a4 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Tue, 9 Nov 2021 15:05:04 +0100 Subject: [PATCH] RangedInteractEvent uses EntityUid exclusively Did anyone else know this event was a thing? --- .../Interaction/InteractionSystem.cs | 2 +- Content.Shared/Interaction/IRangedInteract.cs | 29 +++++-------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/Content.Server/Interaction/InteractionSystem.cs b/Content.Server/Interaction/InteractionSystem.cs index c8fa063026..be13f7e538 100644 --- a/Content.Server/Interaction/InteractionSystem.cs +++ b/Content.Server/Interaction/InteractionSystem.cs @@ -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; diff --git a/Content.Shared/Interaction/IRangedInteract.cs b/Content.Shared/Interaction/IRangedInteract.cs index 45a3e17e1c..89b1f0eb00 100644 --- a/Content.Shared/Interaction/IRangedInteract.cs +++ b/Content.Shared/Interaction/IRangedInteract.cs @@ -44,43 +44,28 @@ namespace Content.Shared.Interaction /// /// Entity that triggered the interaction. /// - public IEntity User { get; } - - /// - /// Entity that triggered the interaction. - /// - public EntityUid UserUid => User.Uid; + public EntityUid UserUid { get; } /// /// Entity that the user used to interact. /// - public IEntity Used { get; } - - /// - /// Entity that the user used to interact. - /// - public EntityUid UsedUid => Used.Uid; + public EntityUid UsedUid { get; } /// /// Entity that was interacted on. /// - public IEntity Target { get; } - - /// - /// Entity that was interacted on. - /// - public EntityUid TargetUid => Target.Uid; + public EntityUid TargetUid { get; } /// /// Location that the user clicked outside of their interaction range. /// 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; } }