Evac shuttle (#8931)

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-06-26 15:20:45 +10:00
committed by GitHub
parent f647c8a658
commit 521ed99766
73 changed files with 5336 additions and 188 deletions

View File

@@ -33,10 +33,10 @@ namespace Content.Shared.Movement.Components
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
private GameTick _lastInputTick;
private ushort _lastInputSubTick;
private Vector2 _curTickWalkMovement;
private Vector2 _curTickSprintMovement;
public GameTick _lastInputTick;
public ushort _lastInputSubTick;
public Vector2 CurTickWalkMovement;
public Vector2 CurTickSprintMovement;
private MoveButtons _heldMoveButtons = MoveButtons.None;
@@ -89,8 +89,8 @@ namespace Content.Shared.Movement.Components
}
else
{
walk = _curTickWalkMovement;
sprint = _curTickSprintMovement;
walk = CurTickWalkMovement;
sprint = CurTickSprintMovement;
remainingFraction = (ushort.MaxValue - _lastInputSubTick) / (float) ushort.MaxValue;
}
@@ -120,7 +120,6 @@ namespace Content.Shared.Movement.Components
protected override void Initialize()
{
base.Initialize();
Owner.EnsureComponentWarn<PhysicsComponent>();
LastGridAngle = _entityManager.GetComponent<TransformComponent>(Owner).Parent?.WorldRotation ?? new Angle(0);
}
@@ -154,8 +153,8 @@ namespace Content.Shared.Movement.Components
if (_gameTiming.CurTick > _lastInputTick)
{
_curTickWalkMovement = Vector2.Zero;
_curTickSprintMovement = Vector2.Zero;
CurTickWalkMovement = Vector2.Zero;
CurTickSprintMovement = Vector2.Zero;
_lastInputTick = _gameTiming.CurTick;
_lastInputSubTick = 0;
}
@@ -164,7 +163,7 @@ namespace Content.Shared.Movement.Components
{
var fraction = (subTick - _lastInputSubTick) / (float) ushort.MaxValue;
ref var lastMoveAmount = ref Sprinting ? ref _curTickSprintMovement : ref _curTickWalkMovement;
ref var lastMoveAmount = ref Sprinting ? ref CurTickSprintMovement : ref CurTickWalkMovement;
lastMoveAmount += DirVecForButtons(_heldMoveButtons) * fraction;