UseDelay + ItemCooldown merge (#22502)
This commit is contained in:
@@ -66,13 +66,14 @@ public sealed class DefibrillatorSystem : EntitySystem
|
||||
|
||||
private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args)
|
||||
{
|
||||
if (args.Handled || _useDelay.ActiveDelay(uid))
|
||||
if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
|
||||
return;
|
||||
|
||||
if (!TryToggle(uid, component, args.User))
|
||||
return;
|
||||
|
||||
args.Handled = true;
|
||||
_useDelay.BeginDelay(uid);
|
||||
_useDelay.TryResetDelay((uid, useDelay));
|
||||
}
|
||||
|
||||
private void OnPowerCellSlotEmpty(EntityUid uid, DefibrillatorComponent component, ref PowerCellSlotEmptyEvent args)
|
||||
|
||||
Reference in New Issue
Block a user