Use Delay Component (#540)
* use delay timer * remove accidental using * and remove accidental newline because i don't proofread my code * compatibility with HUD cooldown suggested changes * get out of here * suggested changes * change to seconds from milliseconds * remove redundancy
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.Components.Timing;
|
||||
using Content.Server.Interfaces.GameObjects;
|
||||
using Content.Shared.Input;
|
||||
using JetBrains.Annotations;
|
||||
@@ -560,6 +561,12 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// </summary>
|
||||
public void UseInteraction(IEntity user, IEntity used)
|
||||
{
|
||||
|
||||
if (used.TryGetComponent<UseDelayComponent>(out var delayComponent))
|
||||
{
|
||||
delayComponent.BeginDelay();
|
||||
}
|
||||
|
||||
var useMsg = new UseInHandMessage(user, used);
|
||||
RaiseEvent(useMsg);
|
||||
if (useMsg.Handled)
|
||||
|
||||
Reference in New Issue
Block a user