From: Justin Pfeifler Date: Thu, 30 Oct 2025 03:17:13 +0000 (-0500) Subject: Rejuvenating Resets Item Charges (#41165) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=5cbc1cba48ba12067b7a3053393f9cdc4654331b;p=space-station-14.git Rejuvenating Resets Item Charges (#41165) * Add check for child entities with charges * Add reset charges on rejuvenate * Revert "Add check for child entities with charges" This reverts commit f55fd69da78ed3240e3b5349c854542516e2d1e1. * Revert "Add reset charges on rejuvenate" This reverts commit ee4221cd87c766d11f6f2a88b72b9de439a26e0a. * Add Reset Charges on Rejuvenate * Apply suggestions from code review * oops I broke it --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- diff --git a/Content.Shared/Charges/Systems/SharedChargesSystem.cs b/Content.Shared/Charges/Systems/SharedChargesSystem.cs index 504648c41d..a48fbaaa8d 100644 --- a/Content.Shared/Charges/Systems/SharedChargesSystem.cs +++ b/Content.Shared/Charges/Systems/SharedChargesSystem.cs @@ -1,6 +1,7 @@ using Content.Shared.Actions.Events; using Content.Shared.Charges.Components; using Content.Shared.Examine; +using Content.Shared.Rejuvenate; using JetBrains.Annotations; using Robust.Shared.Timing; @@ -19,7 +20,7 @@ public abstract class SharedChargesSystem : EntitySystem base.Initialize(); SubscribeLocalEvent(OnExamine); - + SubscribeLocalEvent(OnRejuvenate); SubscribeLocalEvent(OnChargesAttempt); SubscribeLocalEvent(OnChargesMapInit); SubscribeLocalEvent(OnChargesPerformed); @@ -48,6 +49,11 @@ public abstract class SharedChargesSystem : EntitySystem args.PushMarkup(Loc.GetString("limited-charges-recharging", ("seconds", timeRemaining.TotalSeconds.ToString("F1")))); } + private void OnRejuvenate(Entity ent, ref RejuvenateEvent args) + { + ResetCharges(ent.AsNullable()); + } + private void OnChargesAttempt(Entity ent, ref ActionAttemptEvent args) { if (args.Cancelled)