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.
This commit is contained in:
committed by
Pieter-Jan Briers
parent
86d1f808af
commit
1996893a26
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.Components.Mobs;
|
using Content.Server.GameObjects.Components.Mobs;
|
||||||
using Content.Server.GameObjects.Components.Timing;
|
using Content.Server.GameObjects.Components.Timing;
|
||||||
@@ -564,7 +564,10 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
if (used.TryGetComponent<UseDelayComponent>(out var delayComponent))
|
if (used.TryGetComponent<UseDelayComponent>(out var delayComponent))
|
||||||
{
|
{
|
||||||
delayComponent.BeginDelay();
|
if(delayComponent.ActiveDelay)
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
delayComponent.BeginDelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
var useMsg = new UseInHandMessage(user, used);
|
var useMsg = new UseInHandMessage(user, used);
|
||||||
|
|||||||
Reference in New Issue
Block a user