Make InteractUsing async, make tools use DoAfter. (#1772)

* Make IInteractUsing async, make tools use DoAfter.

* Disable warning 1998 in Content.Server

* Update Content.Server/GameObjects/Components/AnchorableComponent.cs
This commit is contained in:
Víctor Aguilera Puerto
2020-08-18 14:39:08 +02:00
committed by GitHub
parent bbdfe44224
commit d9ae942759
45 changed files with 195 additions and 100 deletions

View File

@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Interactable;
using Content.Server.GameObjects.Components.VendingMachines;
using Content.Server.GameObjects.EntitySystems;
@@ -468,11 +469,11 @@ namespace Content.Server.GameObjects.Components
serializer.DataField(ref _layoutId, "LayoutId", null);
}
bool IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
{
if (!eventArgs.Using.TryGetComponent<ToolComponent>(out var tool))
return false;
if (!tool.UseTool(eventArgs.User, Owner, ToolQuality.Screwing))
if (!await tool.UseTool(eventArgs.User, Owner, 0.5f, ToolQuality.Screwing))
return false;
IsPanelOpen = !IsPanelOpen;