Merge stable into master (#37387)
This commit is contained in:
@@ -51,13 +51,18 @@ public abstract class SharedAnomalySystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// anomalies are static by default, so we have set them to dynamic to be throwable
|
// 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);
|
_physics.SetBodyType(ent, BodyType.Dynamic, body: body);
|
||||||
ChangeAnomalyStability(ent, Random.NextFloat(corePowered.StabilityPerThrow.X, corePowered.StabilityPerThrow.Y), ent.Comp);
|
ChangeAnomalyStability(ent, Random.NextFloat(corePowered.StabilityPerThrow.X, corePowered.StabilityPerThrow.Y), ent.Comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLand(Entity<AnomalyComponent> ent, ref LandEvent args)
|
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);
|
_physics.SetBodyType(ent, BodyType.Static);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user