From 685cb9c6713e48653e181c08d7358b36674245d3 Mon Sep 17 00:00:00 2001 From: ForestNoises <33579038+ForestNoises@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:00:02 -0500 Subject: [PATCH] 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> --- Content.Shared/Actions/SharedActionsSystem.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- 2.51.2