Changes resulting from merging Client and Server PhysicsComponent.
This commit is contained in:
@@ -144,10 +144,10 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
public override void OnAdd()
|
||||
{
|
||||
// This component requires that the entity has a PhysicsComponent.
|
||||
if (!Owner.HasComponent<SharedPhysicsComponent>())
|
||||
if (!Owner.HasComponent<PhysicsComponent>())
|
||||
Logger.Error(
|
||||
$"[ECS] {Owner.Prototype?.Name} - {nameof(SharedPlayerInputMoverComponent)} requires" +
|
||||
$" {nameof(SharedPhysicsComponent)}. ");
|
||||
$" {nameof(PhysicsComponent)}. ");
|
||||
|
||||
base.OnAdd();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using Content.Shared.Physics;
|
||||
using Robust.Shared.Configuration;
|
||||
@@ -13,7 +13,6 @@ using Robust.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.Interfaces.Physics;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Players;
|
||||
|
||||
#nullable enable
|
||||
@@ -56,7 +55,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
}
|
||||
|
||||
|
||||
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, SharedPhysicsComponent physics,
|
||||
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, PhysicsComponent physics,
|
||||
CollidableComponent? collider = null)
|
||||
{
|
||||
if (physics.Controller == null)
|
||||
@@ -112,7 +111,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
|
||||
}
|
||||
|
||||
protected abstract void SetController(SharedPhysicsComponent physics);
|
||||
protected abstract void SetController(PhysicsComponent physics);
|
||||
|
||||
private bool IsAroundCollider(ITransformComponent transform, IMoverComponent mover,
|
||||
CollidableComponent collider)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.Interfaces.Physics;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
@@ -9,7 +10,7 @@ namespace Content.Shared.Physics
|
||||
public class MoverController : VirtualController
|
||||
{
|
||||
private Vector2 _velocity;
|
||||
private SharedPhysicsComponent _component = null;
|
||||
private PhysicsComponent _component = null;
|
||||
|
||||
public Vector2 Velocity
|
||||
{
|
||||
@@ -17,7 +18,7 @@ namespace Content.Shared.Physics
|
||||
set => _velocity = value;
|
||||
}
|
||||
|
||||
public override SharedPhysicsComponent ControlledComponent
|
||||
public override PhysicsComponent ControlledComponent
|
||||
{
|
||||
set => _component = value;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.Interfaces.Physics;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
@@ -9,7 +10,7 @@ namespace Content.Shared.Physics
|
||||
public class ThrowController: VirtualController
|
||||
{
|
||||
private float _throwTime;
|
||||
private SharedPhysicsComponent _component;
|
||||
private PhysicsComponent _component;
|
||||
|
||||
public const float DefaultThrowTime = 0.25f;
|
||||
|
||||
@@ -19,7 +20,7 @@ namespace Content.Shared.Physics
|
||||
set => _throwTime = value;
|
||||
}
|
||||
|
||||
public override SharedPhysicsComponent ControlledComponent
|
||||
public override PhysicsComponent ControlledComponent
|
||||
{
|
||||
set => _component = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user