DroppedEvent uses EntityUid exclusively

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 15:03:01 +01:00
parent c10a65d588
commit 22724d06b4
3 changed files with 7 additions and 17 deletions

View File

@@ -60,7 +60,7 @@ namespace Content.Server.Hands.Systems
private void HandleItemDropped(EntityUid uid, HandVirtualItemComponent component, DroppedEvent args) private void HandleItemDropped(EntityUid uid, HandVirtualItemComponent component, DroppedEvent args)
{ {
Delete(component, args.User.Uid); Delete(component, args.UserUid);
} }
/// <summary> /// <summary>

View File

@@ -37,32 +37,22 @@ namespace Content.Shared.Interaction
/// <summary> /// <summary>
/// Entity that dropped the item. /// Entity that dropped the item.
/// </summary> /// </summary>
public IEntity User { get; } public EntityUid UserUid { get; }
/// <summary>
/// Entity that dropped the item.
/// </summary>
public EntityUid UserUid => User.Uid;
/// <summary> /// <summary>
/// Item that was dropped. /// Item that was dropped.
/// </summary> /// </summary>
public IEntity Dropped { get; } public EntityUid DroppedUid { get; }
/// <summary>
/// Item that was dropped.
/// </summary>
public EntityUid DroppedUid => Dropped.Uid;
/// <summary> /// <summary>
/// If the item was dropped intentionally. /// If the item was dropped intentionally.
/// </summary> /// </summary>
public bool Intentional { get; } public bool Intentional { get; }
public DroppedEvent(IEntity user, IEntity dropped, bool intentional) public DroppedEvent(EntityUid user, EntityUid dropped, bool intentional)
{ {
User = user; UserUid = user;
Dropped = dropped; DroppedUid = dropped;
Intentional = intentional; Intentional = intentional;
} }
} }

View File

@@ -672,7 +672,7 @@ namespace Content.Shared.Interaction
/// </summary> /// </summary>
public void DroppedInteraction(IEntity user, IEntity item, bool intentional) 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); RaiseLocalEvent(item.Uid, dropMsg);
if (dropMsg.Handled) if (dropMsg.Handled)
return; return;