From 1996893a262bed6290def614b0d4a000f9b5ab78 Mon Sep 17 00:00:00 2001 From: moneyl <8206401+Moneyl@users.noreply.github.com> Date: Wed, 22 Jan 2020 19:37:07 -0500 Subject: [PATCH] Fix UseDelayComponent (#546) Currently if this component is present the delay timer is started but it doesn't actually prevent use interactions. To test this bug, do the following: 1. Set the delay for [bike_horn](https://github.com/space-wizards/space-station-14/blob/master/Resources/Prototypes/Entities/items/bike_horn.yml#L25) to something large like 5.0 that'll make the effect obvious 2. Use the bike horn with the z key. The delay anim will play properly but you'll still be able to spam the honk. --- .../GameObjects/EntitySystems/Click/InteractionSystem.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index f3d19d7b56..4fc865182a 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Timing; @@ -564,7 +564,10 @@ namespace Content.Server.GameObjects.EntitySystems if (used.TryGetComponent(out var delayComponent)) { - delayComponent.BeginDelay(); + if(delayComponent.ActiveDelay) + return; + else + delayComponent.BeginDelay(); } var useMsg = new UseInHandMessage(user, used);