Make UseDelay SetLength do EnsureComp (#27601)

Make UseDelay.SetLength do EnsureComp
This commit is contained in:
Tayrtahn
2024-05-02 08:16:16 -04:00
committed by GitHub
parent 05f0fddf5d
commit 236da1cd27
3 changed files with 12 additions and 10 deletions

View File

@@ -135,11 +135,8 @@ public abstract class SharedStorageSystem : EntitySystem
private void OnMapInit(Entity<StorageComponent> entity, ref MapInitEvent args)
{
if (TryComp<UseDelayComponent>(entity, out var useDelayComp))
{
UseDelay.SetLength((entity, useDelayComp), entity.Comp.QuickInsertCooldown, QuickInsertUseDelayID);
UseDelay.SetLength((entity, useDelayComp), entity.Comp.OpenUiCooldown, OpenUiUseDelayID);
}
UseDelay.SetLength(entity.Owner, entity.Comp.QuickInsertCooldown, QuickInsertUseDelayID);
UseDelay.SetLength(entity.Owner, entity.Comp.OpenUiCooldown, OpenUiUseDelayID);
}
private void OnStorageGetState(EntityUid uid, StorageComponent component, ref ComponentGetState args)