Separate jetpack movement speed modifier (#9363)

This commit is contained in:
TekuNut
2022-07-07 19:29:25 +01:00
committed by GitHub
parent abaf850ea5
commit 6eba481657
8 changed files with 51 additions and 28 deletions

View File

@@ -4,16 +4,6 @@ namespace Content.Shared.Movement.Components
// There can only be one.
public interface IMoverComponent : IComponent
{
/// <summary>
/// Movement speed (m/s) that the entity walks.
/// </summary>
float CurrentWalkSpeed { get; }
/// <summary>
/// Movement speed (m/s) that the entity sprints.
/// </summary>
float CurrentSprintSpeed { get; }
/// <summary>
/// Is the entity Sprinting (running)?
/// </summary>

View File

@@ -5,8 +5,7 @@ namespace Content.Shared.Movement.Components
public sealed class SharedDummyInputMoverComponent : Component, IMoverComponent
{
public bool IgnorePaused => false;
public float CurrentWalkSpeed => 0f;
public float CurrentSprintSpeed => 0f;
public bool CanMove { get; set; } = true;
public Angle LastGridAngle { get => Angle.Zero; set {} }

View File

@@ -43,18 +43,6 @@ namespace Content.Shared.Movement.Components
[ViewVariables]
public Angle LastGridAngle { get; set; } = new(0);
public float CurrentWalkSpeed =>
_entityManager.TryGetComponent<MovementSpeedModifierComponent>(Owner,
out var movementSpeedModifierComponent)
? movementSpeedModifierComponent.CurrentWalkSpeed
: MovementSpeedModifierComponent.DefaultBaseWalkSpeed;
public float CurrentSprintSpeed =>
_entityManager.TryGetComponent<MovementSpeedModifierComponent>(Owner,
out var movementSpeedModifierComponent)
? movementSpeedModifierComponent.CurrentSprintSpeed
: MovementSpeedModifierComponent.DefaultBaseSprintSpeed;
public bool Sprinting => !HasFlag(_heldMoveButtons, MoveButtons.Walk);
[ViewVariables(VVAccess.ReadWrite)]