From 61089355f047da92b8e2e19c70a26fbd73715d60 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Wed, 18 Sep 2024 01:19:34 +0300 Subject: [PATCH] Fix Anomaly infections infinity growing after curing (#32259) --- Content.Client/Anomaly/AnomalySystem.cs | 12 +++++++++++- Content.Shared/Anomaly/SharedAnomalySystem.cs | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Content.Client/Anomaly/AnomalySystem.cs b/Content.Client/Anomaly/AnomalySystem.cs index c93f0ce949..28c015f302 100644 --- a/Content.Client/Anomaly/AnomalySystem.cs +++ b/Content.Client/Anomaly/AnomalySystem.cs @@ -20,8 +20,9 @@ public sealed class AnomalySystem : SharedAnomalySystem SubscribeLocalEvent(OnAppearanceChanged); SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnAnimationComplete); - } + SubscribeLocalEvent(OnShutdown); + } private void OnStartup(EntityUid uid, AnomalyComponent component, ComponentStartup args) { _floating.FloatAnimation(uid, component.FloatingOffset, component.AnimationKey, component.AnimationTime); @@ -75,4 +76,13 @@ public sealed class AnomalySystem : SharedAnomalySystem } } } + + private void OnShutdown(Entity ent, ref ComponentShutdown args) + { + if (!TryComp(ent, out var sprite)) + return; + + sprite.Scale = Vector2.One; + sprite.Color = sprite.Color.WithAlpha(1f); + } } diff --git a/Content.Shared/Anomaly/SharedAnomalySystem.cs b/Content.Shared/Anomaly/SharedAnomalySystem.cs index 9a0cde2998..07beb1444d 100644 --- a/Content.Shared/Anomaly/SharedAnomalySystem.cs +++ b/Content.Shared/Anomaly/SharedAnomalySystem.cs @@ -194,6 +194,8 @@ public abstract class SharedAnomalySystem : EntitySystem if (component.DeleteEntity) QueueDel(uid); + else + RemCompDeferred(uid); } ///