From 45253ca79ed7a03d43716bc63908ffe90c8c7ce1 Mon Sep 17 00:00:00 2001 From: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Date: Mon, 12 May 2025 23:27:46 +0200 Subject: [PATCH] [Hotfix] Fix anomalies breaking your legs (#37366) * Update SharedAnomalySystem.cs * oops --- Content.Shared/Anomaly/SharedAnomalySystem.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Anomaly/SharedAnomalySystem.cs b/Content.Shared/Anomaly/SharedAnomalySystem.cs index dd07cf0441..b36fec7a02 100644 --- a/Content.Shared/Anomaly/SharedAnomalySystem.cs +++ b/Content.Shared/Anomaly/SharedAnomalySystem.cs @@ -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(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 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(ent, out var body) || body.BodyType != BodyType.Dynamic) + return; + _physics.SetBodyType(ent, BodyType.Static); }