From 22724d06b4a0590c958c65fc5a4e14c9c7c0b363 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Tue, 9 Nov 2021 15:03:01 +0100 Subject: [PATCH] DroppedEvent uses EntityUid exclusively --- .../Hands/Systems/HandVirtualItemSystem.cs | 2 +- Content.Shared/Interaction/IDropped.cs | 20 +++++-------------- .../Interaction/SharedInteractionSystem.cs | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Content.Server/Hands/Systems/HandVirtualItemSystem.cs b/Content.Server/Hands/Systems/HandVirtualItemSystem.cs index fd2636bac9..fa9937a6e4 100644 --- a/Content.Server/Hands/Systems/HandVirtualItemSystem.cs +++ b/Content.Server/Hands/Systems/HandVirtualItemSystem.cs @@ -60,7 +60,7 @@ namespace Content.Server.Hands.Systems private void HandleItemDropped(EntityUid uid, HandVirtualItemComponent component, DroppedEvent args) { - Delete(component, args.User.Uid); + Delete(component, args.UserUid); } /// diff --git a/Content.Shared/Interaction/IDropped.cs b/Content.Shared/Interaction/IDropped.cs index 613853cb9c..2b4e465556 100644 --- a/Content.Shared/Interaction/IDropped.cs +++ b/Content.Shared/Interaction/IDropped.cs @@ -37,32 +37,22 @@ namespace Content.Shared.Interaction /// /// Entity that dropped the item. /// - public IEntity User { get; } - - /// - /// Entity that dropped the item. - /// - public EntityUid UserUid => User.Uid; + public EntityUid UserUid { get; } /// /// Item that was dropped. /// - public IEntity Dropped { get; } - - /// - /// Item that was dropped. - /// - public EntityUid DroppedUid => Dropped.Uid; + public EntityUid DroppedUid { get; } /// /// If the item was dropped intentionally. /// public bool Intentional { get; } - public DroppedEvent(IEntity user, IEntity dropped, bool intentional) + public DroppedEvent(EntityUid user, EntityUid dropped, bool intentional) { - User = user; - Dropped = dropped; + UserUid = user; + DroppedUid = dropped; Intentional = intentional; } } diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 8c047e53f9..ebe839b24d 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -672,7 +672,7 @@ namespace Content.Shared.Interaction /// public void DroppedInteraction(IEntity user, IEntity item, bool intentional) { - var dropMsg = new DroppedEvent(user, item, intentional); + var dropMsg = new DroppedEvent(user.Uid, item.Uid, intentional); RaiseLocalEvent(item.Uid, dropMsg); if (dropMsg.Handled) return;