Fix use delay (#6031)

This commit is contained in:
Leon Friedrich
2022-01-06 14:51:34 +13:00
committed by GitHub
parent 5b1cd2dd96
commit d6f0e71cba
2 changed files with 15 additions and 20 deletions

View File

@@ -46,12 +46,9 @@ namespace Content.Shared.Timing
_lastUseTime = IoCManager.Resolve<IGameTiming>().CurTime;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ItemCooldownComponent? cooldown))
{
cooldown.CooldownStart = _lastUseTime;
cooldown.CooldownEnd = _lastUseTime + TimeSpan.FromSeconds(Delay);
}
var cooldown = IoCManager.Resolve<IEntityManager>().EnsureComponent<ItemCooldownComponent>(Owner);
cooldown.CooldownStart = _lastUseTime;
cooldown.CooldownEnd = _lastUseTime + TimeSpan.FromSeconds(Delay);
}
public void Cancel()