Content update for ECS physics (#13291)
This commit is contained in:
@@ -4,6 +4,7 @@ using Robust.Server.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
|
||||
namespace Content.Server.Maps;
|
||||
|
||||
@@ -11,6 +12,7 @@ namespace Content.Server.Maps;
|
||||
public sealed class GridDraggingSystem : SharedGridDraggingSystem
|
||||
{
|
||||
[Dependency] private readonly IConGroupController _admin = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
|
||||
private readonly HashSet<ICommonSession> _draggers = new();
|
||||
|
||||
@@ -54,8 +56,8 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
|
||||
Deleted(ev.Grid)) return;
|
||||
|
||||
var gridBody = Comp<PhysicsComponent>(ev.Grid);
|
||||
gridBody.LinearVelocity = ev.LinearVelocity;
|
||||
gridBody.AngularVelocity = 0f;
|
||||
_physics.SetLinearVelocity(ev.Grid, ev.LinearVelocity, body: gridBody);
|
||||
_physics.SetAngularVelocity(ev.Grid, 0f, body: gridBody);
|
||||
}
|
||||
|
||||
private void OnRequestDrag(GridDragRequestPosition msg, EntitySessionEventArgs args)
|
||||
|
||||
Reference in New Issue
Block a user