]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Anomaly infections infinity growing after curing (#32259)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Tue, 17 Sep 2024 22:19:34 +0000 (01:19 +0300)
committerGitHub <noreply@github.com>
Tue, 17 Sep 2024 22:19:34 +0000 (00:19 +0200)
Content.Client/Anomaly/AnomalySystem.cs
Content.Shared/Anomaly/SharedAnomalySystem.cs

index c93f0ce9490174976c818387d8d41b8a97abe9ae..28c015f3021cdcfc50502a5dce58f69c6def4887 100644 (file)
@@ -20,8 +20,9 @@ public sealed class AnomalySystem : SharedAnomalySystem
         SubscribeLocalEvent<AnomalyComponent, AppearanceChangeEvent>(OnAppearanceChanged);
         SubscribeLocalEvent<AnomalyComponent, ComponentStartup>(OnStartup);
         SubscribeLocalEvent<AnomalyComponent, AnimationCompletedEvent>(OnAnimationComplete);
-    }
 
+        SubscribeLocalEvent<AnomalySupercriticalComponent, ComponentShutdown>(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<AnomalySupercriticalComponent> ent, ref ComponentShutdown args)
+    {
+        if (!TryComp<SpriteComponent>(ent, out var sprite))
+            return;
+
+        sprite.Scale = Vector2.One;
+        sprite.Color = sprite.Color.WithAlpha(1f);
+    }
 }
index 9a0cde29988cb3605fe1866c2e7292f43455e734..07beb1444d765379b9a895c91b03d0ac24c0106a 100644 (file)
@@ -194,6 +194,8 @@ public abstract class SharedAnomalySystem : EntitySystem
 
         if (component.DeleteEntity)
             QueueDel(uid);
+        else
+            RemCompDeferred<AnomalySupercriticalComponent>(uid);
     }
 
     /// <summary>