]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[Hotfix] Fix anomalies breaking your legs (#37366)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Mon, 12 May 2025 21:27:46 +0000 (23:27 +0200)
committerGitHub <noreply@github.com>
Mon, 12 May 2025 21:27:46 +0000 (23:27 +0200)
* Update SharedAnomalySystem.cs

* oops

Content.Shared/Anomaly/SharedAnomalySystem.cs

index dd07cf0441aa763f1cafb8619dbb2dacef0f6d9c..b36fec7a02fbae4a0866df8dea1a5d3258ceb727 100644 (file)
@@ -51,13 +51,18 @@ public abstract class SharedAnomalySystem : EntitySystem
             return;
 
         // anomalies are static by default, so we have set them to dynamic to be throwable
-        _physics.SetBodyType(ent, BodyType.Dynamic, body: body);
+        // only regular anomalies are static, so the check is meant to filter out things such as infection anomalies, which affect players
+        if (TryComp<PhysicsComponent>(ent, out var physics) && physics.BodyType == BodyType.Static)
+            _physics.SetBodyType(ent, BodyType.Dynamic, body: body);
         ChangeAnomalyStability(ent, Random.NextFloat(corePowered.StabilityPerThrow.X, corePowered.StabilityPerThrow.Y), ent.Comp);
     }
 
     private void OnLand(Entity<AnomalyComponent> ent, ref LandEvent args)
     {
-        // revert back to static
+        // revert back to static, but only if the object was dynamic (such as thrown anomalies, but not anomaly infected players)
+        if (!TryComp<PhysicsComponent>(ent, out var body) || body.BodyType != BodyType.Dynamic)
+            return;
+
         _physics.SetBodyType(ent, BodyType.Static);
     }