@@ -5,6 +5,7 @@ using Content.Server.GameObjects.Components.Sound;
|
|||||||
using Content.Server.Interfaces.GameObjects.Components.Movement;
|
using Content.Server.Interfaces.GameObjects.Components.Movement;
|
||||||
using Content.Shared.Audio;
|
using Content.Shared.Audio;
|
||||||
using Content.Shared.GameObjects.Components.Inventory;
|
using Content.Shared.GameObjects.Components.Inventory;
|
||||||
|
using Content.Shared.GameObjects.Components.Movement;
|
||||||
using Content.Shared.Maps;
|
using Content.Shared.Maps;
|
||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -151,7 +152,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
physics.SetController<MoverController>();
|
physics.SetController<MoverController>();
|
||||||
}
|
}
|
||||||
|
|
||||||
var weightless = _physicsManager.IsWeightless(transform.GridPosition);
|
var weightless = !transform.Owner.HasComponent<MovementIgnoreGravityComponent>() &&
|
||||||
|
_physicsManager.IsWeightless(transform.GridPosition);
|
||||||
|
|
||||||
if (weightless && collider != null)
|
if (weightless && collider != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
|
||||||
|
namespace Content.Shared.GameObjects.Components.Movement
|
||||||
|
{
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class MovementIgnoreGravityComponent : Component
|
||||||
|
{
|
||||||
|
public override string Name => "MovementIgnoreGravity";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using Content.Shared.GameObjects.Components.Movement;
|
||||||
using Robust.Shared.Interfaces.Physics;
|
using Robust.Shared.Interfaces.Physics;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
@@ -6,7 +6,7 @@ using Robust.Shared.Physics;
|
|||||||
|
|
||||||
namespace Content.Shared.Physics
|
namespace Content.Shared.Physics
|
||||||
{
|
{
|
||||||
public class MoverController: VirtualController
|
public class MoverController : VirtualController
|
||||||
{
|
{
|
||||||
private Vector2 _velocity;
|
private Vector2 _velocity;
|
||||||
private SharedPhysicsComponent _component = null;
|
private SharedPhysicsComponent _component = null;
|
||||||
@@ -29,7 +29,8 @@ namespace Content.Shared.Physics
|
|||||||
|
|
||||||
public void Move(Vector2 velocityDirection, float speed)
|
public void Move(Vector2 velocityDirection, float speed)
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IPhysicsManager>().IsWeightless(_component.Owner.Transform.GridPosition)) return;
|
if (!_component.Owner.HasComponent<MovementIgnoreGravityComponent>() && IoCManager
|
||||||
|
.Resolve<IPhysicsManager>().IsWeightless(_component.Owner.Transform.GridPosition)) return;
|
||||||
Push(velocityDirection, speed);
|
Push(velocityDirection, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,3 +26,5 @@
|
|||||||
- type: MovementSpeedModifier
|
- type: MovementSpeedModifier
|
||||||
baseSprintSpeed: 14
|
baseSprintSpeed: 14
|
||||||
baseWalkSpeed: 7
|
baseWalkSpeed: 7
|
||||||
|
|
||||||
|
- type: MovementIgnoreGravity
|
||||||
|
|||||||
Reference in New Issue
Block a user