Merge stable into master (#37387)

This commit is contained in:
slarticodefast
2025-05-12 23:40:55 +02:00
committed by GitHub

View 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
// 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);
}