Fix build (#1447)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Content.Shared.GameObjects.Components.Movement;
|
#nullable enable
|
||||||
|
using Content.Shared.GameObjects.Components.Movement;
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.Physics;
|
using Robust.Shared.Interfaces.Physics;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
@@ -10,7 +11,7 @@ namespace Content.Shared.Physics
|
|||||||
public class MoverController : VirtualController
|
public class MoverController : VirtualController
|
||||||
{
|
{
|
||||||
private Vector2 _velocity;
|
private Vector2 _velocity;
|
||||||
private ICollidableComponent _component = null;
|
private ICollidableComponent? _component;
|
||||||
|
|
||||||
public Vector2 Velocity
|
public Vector2 Velocity
|
||||||
{
|
{
|
||||||
@@ -30,8 +31,8 @@ namespace Content.Shared.Physics
|
|||||||
|
|
||||||
public void Move(Vector2 velocityDirection, float speed)
|
public void Move(Vector2 velocityDirection, float speed)
|
||||||
{
|
{
|
||||||
if (!_component.Owner.HasComponent<MovementIgnoreGravityComponent>() && IoCManager
|
if (_component?.Owner.HasComponent<MovementIgnoreGravityComponent>() == false
|
||||||
.Resolve<IPhysicsManager>().IsWeightless(_component.Owner.Transform.GridPosition)) return;
|
&& IoCManager.Resolve<IPhysicsManager>().IsWeightless(_component.Owner.Transform.GridPosition)) return;
|
||||||
Push(velocityDirection, speed);
|
Push(velocityDirection, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +50,11 @@ namespace Content.Shared.Physics
|
|||||||
{
|
{
|
||||||
base.UpdateBeforeProcessing();
|
base.UpdateBeforeProcessing();
|
||||||
|
|
||||||
|
if (_component == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Velocity == Vector2.Zero)
|
if (Velocity == Vector2.Zero)
|
||||||
{
|
{
|
||||||
// Try to stop movement
|
// Try to stop movement
|
||||||
|
|||||||
Reference in New Issue
Block a user