From: ForestNoises <33579038+ForestNoises@users.noreply.github.com> Date: Tue, 5 Dec 2023 21:00:02 +0000 (-0500) Subject: Action Cooldowns Reset on Rejuvenate (#22149) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=685cb9c6713e48653e181c08d7358b36674245d3;p=space-station-14.git Action Cooldowns Reset on Rejuvenate (#22149) * ActionComponents subscribe to RejuvenateEvent, resets cooldowns * forgo a line * Update Content.Shared/Actions/SharedActionsSystem.cs Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> --- diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index 471e00a572..675727167e 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -15,6 +15,7 @@ using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Timing; using Robust.Shared.Utility; +using Content.Shared.Rejuvenate; namespace Content.Shared.Actions; @@ -38,6 +39,7 @@ public abstract class SharedActionsSystem : EntitySystem SubscribeLocalEvent(OnHandEquipped); SubscribeLocalEvent(OnDidUnequip); SubscribeLocalEvent(OnHandUnequipped); + SubscribeLocalEvent(OnRejuventate); SubscribeLocalEvent(OnShutdown); @@ -163,6 +165,14 @@ public abstract class SharedActionsSystem : EntitySystem Dirty(actionId.Value, action); } + private void OnRejuventate(EntityUid uid, ActionsComponent component, RejuvenateEvent args) + { + foreach (var act in component.Actions) + { + ClearCooldown(act); + } + } + #region ComponentStateManagement protected virtual void UpdateAction(EntityUid? actionId, BaseActionComponent? action = null) {