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)
{
Delete(component, args.User.Uid);
Delete(component, args.UserUid);
}
/// <summary>

View File

@@ -37,32 +37,22 @@ namespace Content.Shared.Interaction
/// <summary>
/// Entity that dropped the item.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that dropped the item.
/// </summary>
public EntityUid UserUid => User.Uid;
public EntityUid UserUid { get; }
/// <summary>
/// Item that was dropped.
/// </summary>
public IEntity Dropped { get; }
/// <summary>
/// Item that was dropped.
/// </summary>
public EntityUid DroppedUid => Dropped.Uid;
public EntityUid DroppedUid { get; }
/// <summary>
/// If the item was dropped intentionally.
/// </summary>
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;
}
}

View File

@@ -672,7 +672,7 @@ namespace Content.Shared.Interaction
/// </summary>
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;