Fix async usage in InteractionSystem

Fixes #2524
This commit is contained in:
Víctor Aguilera Puerto
2020-11-10 22:47:43 +01:00
parent e567e9fec1
commit 44ee2b7ab6
3 changed files with 6 additions and 10 deletions

View File

@@ -1,10 +1,8 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.GUI;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Movement;
using Content.Server.GameObjects.Components.Pulling;
using Content.Server.GameObjects.Components.Timing;
using Content.Server.Interfaces.GameObjects.Components.Items;
@@ -13,14 +11,12 @@ using Content.Shared.GameObjects.EntitySystemMessages;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Input;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Physics.Pull;
using Content.Shared.Utility;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.Interfaces.Player;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.Interfaces.GameObjects;
@@ -288,7 +284,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
return pull.TogglePull(player);
}
private void UserInteraction(IEntity player, EntityCoordinates coordinates, EntityUid clickedUid)
private async void UserInteraction(IEntity player, EntityCoordinates coordinates, EntityUid clickedUid)
{
// Get entity clicked upon from UID if valid UID, if not assume no entity clicked upon and null
if (!EntityManager.TryGetEntity(clickedUid, out var attacked))
@@ -393,7 +389,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
// InteractUsing/AfterInteract: We will either use the item on the nearby object
if (item != null)
{
_ = Interaction(player, item, attacked, coordinates);
await Interaction(player, item, attacked, coordinates);
}
// InteractHand/Activate: Since our hand is empty we will use InteractHand/Activate
else