Content update for ECS physics (#13291)

This commit is contained in:
metalgearsloth
2023-01-15 15:38:59 +11:00
committed by GitHub
parent 46d24bc36b
commit bf79d76666
61 changed files with 431 additions and 379 deletions

View File

@@ -13,6 +13,7 @@ using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.EntitySystems
@@ -22,6 +23,7 @@ namespace Content.Server.Chemistry.EntitySystems
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly ThrowingSystem _throwing = default!;
@@ -37,7 +39,7 @@ namespace Content.Server.Chemistry.EntitySystems
{
if (!EntityManager.TryGetComponent(uid, out SolutionContainerManagerComponent? contents)) return;
foreach (var (_, value) in contents.Solutions)
foreach (var value in contents.Solutions.Values)
{
value.DoEntityReaction(args.OtherFixture.Body.Owner, ReactionMethod.Touch);
}
@@ -58,8 +60,8 @@ namespace Content.Server.Chemistry.EntitySystems
// Set Move
if (EntityManager.TryGetComponent(vapor.Owner, out PhysicsComponent? physics))
{
physics.LinearDamping = 0f;
physics.AngularDamping = 0f;
_physics.SetLinearDamping(physics, 0f);
_physics.SetAngularDamping(physics, 0f);
_throwing.TryThrow(vapor.Owner, dir * speed, user: user, pushbackRatio: 50f);