Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -50,24 +50,34 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
private void OnRequestVelocity(GridDragVelocityRequest ev, EntitySessionEventArgs args)
{
var grid = GetEntity(ev.Grid);
if (args.SenderSession is not IPlayerSession playerSession ||
!_admin.CanCommand(playerSession, CommandName) ||
!Exists(ev.Grid) ||
Deleted(ev.Grid)) return;
!Exists(grid) ||
Deleted(grid))
{
return;
}
var gridBody = Comp<PhysicsComponent>(ev.Grid);
_physics.SetLinearVelocity(ev.Grid, ev.LinearVelocity, body: gridBody);
_physics.SetAngularVelocity(ev.Grid, 0f, body: gridBody);
var gridBody = Comp<PhysicsComponent>(grid);
_physics.SetLinearVelocity(grid, ev.LinearVelocity, body: gridBody);
_physics.SetAngularVelocity(grid, 0f, body: gridBody);
}
private void OnRequestDrag(GridDragRequestPosition msg, EntitySessionEventArgs args)
{
var grid = GetEntity(msg.Grid);
if (args.SenderSession is not IPlayerSession playerSession ||
!_admin.CanCommand(playerSession, CommandName) ||
!Exists(msg.Grid) ||
Deleted(msg.Grid)) return;
!Exists(grid) ||
Deleted(grid))
{
return;
}
var gridXform = Transform(msg.Grid);
var gridXform = Transform(grid);
gridXform.WorldPosition = msg.WorldPosition;
}