Right now ShuttleControllers add the collision component to the Grid Entity.

Adds Grids to the collision group.
This commit is contained in:
Acruid
2020-01-09 18:29:09 -08:00
parent 0db46da30e
commit 51f7f14c08
3 changed files with 13 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ using Robust.Server.Interfaces.GameObjects;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Interfaces.Timing;
@@ -53,6 +54,14 @@ namespace Content.Server.GameObjects.Components.Movement
physComp.Mass = 1;
}
if (!gridEntity.HasComponent<ICollidableComponent>())
{
var collideComp = gridEntity.AddComponent<CollidableComponent>();
collideComp.CollisionEnabled = true;
collideComp.IsHardCollidable = true;
collideComp.PhysicsShapes.Add(new PhysShapeGrid(grid));
}
physComp.LinearVelocity = CalcNewVelocity(direction, enabled) * WalkMoveSpeed;
}
}