Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EE Merge & SecWatch Fix #155

Merged
merged 25 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
da14cfe
Fix Server Crash on Shutdown Due to DB Notifications (#31379) (#1542)
sleepyyapril Jan 14, 2025
1b7d42e
Fix cargo job title not showing up
sleepyyapril Jan 14, 2025
5f464fc
Fixed portal artifacts targeting the Ai (#32677)
Gamer3107 Oct 14, 2024
83d68bf
Add outerclothing as identity blocker
sleepyyapril Jan 14, 2025
7318cfb
Fix layout on wires UI (#33714)
PJB3005 Dec 4, 2024
6bcdd23
Allow ai to understand if its handcuffed. (#30402)
IProduceWidgets Aug 2, 2024
cf121be
Reorder priorities in `MeleeCombatCompound` (#30066)
osjarw Aug 11, 2024
57c3a28
ai stays seated and pulled while cuffed. (#30397)
IProduceWidgets Aug 8, 2024
f9ac956
Sprite Movement working with AI movement (#33494)
TheShuEd Dec 18, 2024
0cd85d0
Fix null exceptions in SurveillanceCameraMonitorSystem (#29275)
Tayrtahn Jun 21, 2024
e91fb14
decouple ItemToggle from PowerCellDraw (#31392)
deltanedas Aug 25, 2024
a17969f
Fix defibs draining battery when turned off (#31593)
themias Aug 28, 2024
fa2fed1
ItemToggle + slots stuff (#31312)
slarticodefast Aug 31, 2024
251a21d
Fix energy shield visuals (#31619)
slarticodefast Aug 30, 2024
1343d73
Fix PDA resolve error
sleepyyapril Jan 14, 2025
04406f6
Fix random bark
sleepyyapril Jan 14, 2025
5bb56c0
Update MoverController.cs to not use Component.Owner (#29965)
Plykiya Aug 2, 2024
7df15b2
Fix errors
sleepyyapril Jan 14, 2025
943982d
Device-list limiting (#30997)
Magicalus Aug 19, 2024
99423d8
Fix more test fails
sleepyyapril Jan 14, 2025
962b841
hm
sleepyyapril Jan 14, 2025
bed3627
More General Fixes (#1547)
sleepyyapril Jan 14, 2025
cfc6e0e
Automatic Changelog Update (#1547)
SimpleStation14 Jan 14, 2025
d8537f0
Merge pull request #424 from Mnemotechnician/floof/fix/secwatch
Fansana Dec 22, 2024
d16463e
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
sleepyyapril Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update MoverController.cs to not use Component.Owner (#29965)
* Update MoverController.cs

* Update a bunch of movement code to use Entity<T>

* Last errors

* wow, there were more errors

---------

Co-authored-by: plykiya <plykiya@protonmail.com>
2 people authored and sleepyyapril committed Jan 14, 2025
commit 5bb56c08d7dd6a64feefa503da3d004f8fb0966c
42 changes: 21 additions & 21 deletions Content.Client/Physics/Controllers/MoverController.cs
Original file line number Diff line number Diff line change
@@ -34,57 +34,57 @@ public override void Initialize()
Subs.CVar(_config, CCVars.DefaultWalk, _ => RaiseNetworkEvent(new UpdateInputCVarsMessage()));
}

private void OnUpdatePredicted(EntityUid uid, InputMoverComponent component, ref UpdateIsPredictedEvent args)
private void OnUpdatePredicted(Entity<InputMoverComponent> entity, ref UpdateIsPredictedEvent args)
{
// Enable prediction if an entity is controlled by the player
if (uid == _playerManager.LocalEntity)
if (entity.Owner == _playerManager.LocalEntity)
args.IsPredicted = true;
}

private void OnUpdateRelayTargetPredicted(EntityUid uid, MovementRelayTargetComponent component, ref UpdateIsPredictedEvent args)
private void OnUpdateRelayTargetPredicted(Entity<MovementRelayTargetComponent> entity, ref UpdateIsPredictedEvent args)
{
if (component.Source == _playerManager.LocalEntity)
if (entity.Comp.Source == _playerManager.LocalEntity)
args.IsPredicted = true;
}

private void OnUpdatePullablePredicted(EntityUid uid, PullableComponent component, ref UpdateIsPredictedEvent args)
private void OnUpdatePullablePredicted(Entity<PullableComponent> entity, ref UpdateIsPredictedEvent args)
{
// Enable prediction if an entity is being pulled by the player.
// Disable prediction if an entity is being pulled by some non-player entity.

if (component.Puller == _playerManager.LocalEntity)
if (entity.Comp.Puller == _playerManager.LocalEntity)
args.IsPredicted = true;
else if (component.Puller != null)
else if (entity.Comp.Puller != null)
args.BlockPrediction = true;

// TODO recursive pulling checks?
// What if the entity is being pulled by a vehicle controlled by the player?
}

private void OnRelayPlayerAttached(EntityUid uid, RelayInputMoverComponent component, LocalPlayerAttachedEvent args)
private void OnRelayPlayerAttached(Entity<RelayInputMoverComponent> entity, ref LocalPlayerAttachedEvent args)
{
Physics.UpdateIsPredicted(uid);
Physics.UpdateIsPredicted(component.RelayEntity);
if (MoverQuery.TryGetComponent(component.RelayEntity, out var inputMover))
SetMoveInput(inputMover, MoveButtons.None);
Physics.UpdateIsPredicted(entity.Owner);
Physics.UpdateIsPredicted(entity.Comp.RelayEntity);
if (MoverQuery.TryGetComponent(entity.Comp.RelayEntity, out var inputMover))
SetMoveInput((entity.Owner, inputMover), MoveButtons.None);
}

private void OnRelayPlayerDetached(EntityUid uid, RelayInputMoverComponent component, LocalPlayerDetachedEvent args)
private void OnRelayPlayerDetached(Entity<RelayInputMoverComponent> entity, ref LocalPlayerDetachedEvent args)
{
Physics.UpdateIsPredicted(uid);
Physics.UpdateIsPredicted(component.RelayEntity);
if (MoverQuery.TryGetComponent(component.RelayEntity, out var inputMover))
SetMoveInput(inputMover, MoveButtons.None);
Physics.UpdateIsPredicted(entity.Owner);
Physics.UpdateIsPredicted(entity.Comp.RelayEntity);
if (MoverQuery.TryGetComponent(entity.Comp.RelayEntity, out var inputMover))
SetMoveInput((entity.Owner, inputMover), MoveButtons.None);
}

private void OnPlayerAttached(EntityUid uid, InputMoverComponent component, LocalPlayerAttachedEvent args)
private void OnPlayerAttached(Entity<InputMoverComponent> entity, ref LocalPlayerAttachedEvent args)
{
SetMoveInput(component, MoveButtons.None);
SetMoveInput(entity, MoveButtons.None);
}

private void OnPlayerDetached(EntityUid uid, InputMoverComponent component, LocalPlayerDetachedEvent args)
private void OnPlayerDetached(Entity<InputMoverComponent> entity, ref LocalPlayerDetachedEvent args)
{
SetMoveInput(component, MoveButtons.None);
SetMoveInput(entity, MoveButtons.None);
}

public override void UpdateBeforeSolve(bool prediction, float frameTime)
2 changes: 1 addition & 1 deletion Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ public override void Initialize()
private void OnRelayMoveInput(Entity<BodyComponent> ent, ref MoveInputEvent args)
{
// If they haven't actually moved then ignore it.
if ((args.Component.HeldMoveButtons &
if ((args.Entity.Comp.HeldMoveButtons &
(MoveButtons.Down | MoveButtons.Left | MoveButtons.Up | MoveButtons.Right)) == 0x0)
{
return;
2 changes: 1 addition & 1 deletion Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ private void OnActionPerform(EntityUid uid, GhostComponent component, BooActionE
private void OnRelayMoveInput(EntityUid uid, GhostOnMoveComponent component, ref MoveInputEvent args)
{
// If they haven't actually moved then ignore it.
if ((args.Component.HeldMoveButtons &
if ((args.Entity.Comp.HeldMoveButtons &
(MoveButtons.Down | MoveButtons.Left | MoveButtons.Up | MoveButtons.Right)) == 0x0)
{
return;
20 changes: 10 additions & 10 deletions Content.Server/Physics/Controllers/MoverController.cs
Original file line number Diff line number Diff line change
@@ -30,26 +30,26 @@ public override void Initialize()
SubscribeLocalEvent<InputMoverComponent, PlayerDetachedEvent>(OnPlayerDetached);
}

private void OnRelayPlayerAttached(EntityUid uid, RelayInputMoverComponent component, PlayerAttachedEvent args)
private void OnRelayPlayerAttached(Entity<RelayInputMoverComponent> entity, ref PlayerAttachedEvent args)
{
if (MoverQuery.TryGetComponent(component.RelayEntity, out var inputMover))
SetMoveInput(inputMover, MoveButtons.None);
if (MoverQuery.TryGetComponent(entity.Comp.RelayEntity, out var inputMover))
SetMoveInput((entity.Owner, inputMover), MoveButtons.None);
}

private void OnRelayPlayerDetached(EntityUid uid, RelayInputMoverComponent component, PlayerDetachedEvent args)
private void OnRelayPlayerDetached(Entity<RelayInputMoverComponent> entity, ref PlayerDetachedEvent args)
{
if (MoverQuery.TryGetComponent(component.RelayEntity, out var inputMover))
SetMoveInput(inputMover, MoveButtons.None);
if (MoverQuery.TryGetComponent(entity.Comp.RelayEntity, out var inputMover))
SetMoveInput((entity.Owner, inputMover), MoveButtons.None);
}

private void OnPlayerAttached(EntityUid uid, InputMoverComponent component, PlayerAttachedEvent args)
private void OnPlayerAttached(Entity<InputMoverComponent> entity, ref PlayerAttachedEvent args)
{
SetMoveInput(component, MoveButtons.None);
SetMoveInput(entity, MoveButtons.None);
}

private void OnPlayerDetached(EntityUid uid, InputMoverComponent component, PlayerDetachedEvent args)
private void OnPlayerDetached(Entity<InputMoverComponent> entity, ref PlayerDetachedEvent args)
{
SetMoveInput(component, MoveButtons.None);
SetMoveInput(entity, MoveButtons.None);
}

protected override bool CanSound()
8 changes: 3 additions & 5 deletions Content.Shared/Movement/Events/MoveInputEvent.cs
Original file line number Diff line number Diff line change
@@ -9,16 +9,14 @@ namespace Content.Shared.Movement.Events;
[ByRefEvent]
public readonly struct MoveInputEvent
{
public readonly EntityUid Entity;
public readonly InputMoverComponent Component;
public readonly Entity<InputMoverComponent> Entity;
public readonly MoveButtons OldMovement;

public bool HasDirectionalMovement => (Component.HeldMoveButtons & MoveButtons.AnyDirection) != MoveButtons.None;
public bool HasDirectionalMovement => (Entity.Comp.HeldMoveButtons & MoveButtons.AnyDirection) != MoveButtons.None;

public MoveInputEvent(EntityUid entity, InputMoverComponent component, MoveButtons oldMovement)
public MoveInputEvent(Entity<InputMoverComponent> entity, MoveButtons oldMovement)
{
Entity = entity;
Component = component;
OldMovement = oldMovement;
}
}
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ private void OnMindAdded(Entity<InputMoverComponent> ent, ref MindAddedMessage a
return;

ent.Comp.DefaultSprinting = _netConfig.GetClientCVar(channel, CCVars.DefaultWalk);
WalkingAlert(ent, ent.Comp);
WalkingAlert(ent);
}

private void OnMindRemoved(Entity<InputMoverComponent> ent, ref MindRemovedMessage args)
133 changes: 65 additions & 68 deletions Content.Shared/Movement/Systems/SharedMoverController.Input.cs
Original file line number Diff line number Diff line change
@@ -85,9 +85,9 @@ public static MoveButtons GetNormalizedMovement(MoveButtons buttons)
return oldMovement;
}

protected void SetMoveInput(InputMoverComponent component, MoveButtons buttons)
protected void SetMoveInput(Entity<InputMoverComponent> entity, MoveButtons buttons)
{
if (component.HeldMoveButtons == buttons)
if (entity.Comp.HeldMoveButtons == buttons)
return;

// Relay the fact we had any movement event.
@@ -96,29 +96,26 @@ protected void SetMoveInput(InputMoverComponent component, MoveButtons buttons)
entity.Comp.HeldMoveButtons = buttons;
RaiseLocalEvent(entity, ref moveEvent);
Dirty(entity, entity.Comp);

var ev = new SpriteMoveEvent(entity.Comp.HeldMoveButtons != MoveButtons.None);
RaiseLocalEvent(entity, ref ev);
}

private void OnMoverHandleState(EntityUid uid, InputMoverComponent component, ComponentHandleState args)
private void OnMoverHandleState(Entity<InputMoverComponent> entity, ref ComponentHandleState args)
{
if (args.Current is not InputMoverComponentState state)
return;

// Handle state
component.LerpTarget = state.LerpTarget;
component.RelativeRotation = state.RelativeRotation;
component.TargetRelativeRotation = state.TargetRelativeRotation;
component.CanMove = state.CanMove;
component.RelativeEntity = EnsureEntity<InputMoverComponent>(state.RelativeEntity, uid);
component.DefaultSprinting = state.DefaultSprinting;
entity.Comp.LerpTarget = state.LerpTarget;
entity.Comp.RelativeRotation = state.RelativeRotation;
entity.Comp.TargetRelativeRotation = state.TargetRelativeRotation;
entity.Comp.CanMove = state.CanMove;
entity.Comp.RelativeEntity = EnsureEntity<InputMoverComponent>(state.RelativeEntity, entity.Owner);
entity.Comp.DefaultSprinting = state.DefaultSprinting;

// Reset
component.LastInputTick = GameTick.Zero;
component.LastInputSubTick = 0;
entity.Comp.LastInputTick = GameTick.Zero;
entity.Comp.LastInputSubTick = 0;

if (component.HeldMoveButtons != state.HeldMoveButtons)
if (entity.Comp.HeldMoveButtons != state.HeldMoveButtons)
{
var moveEvent = new MoveInputEvent(entity, entity.Comp.HeldMoveButtons);
entity.Comp.HeldMoveButtons = state.HeldMoveButtons;
@@ -129,17 +126,17 @@ private void OnMoverHandleState(EntityUid uid, InputMoverComponent component, Co
}
}

private void OnMoverGetState(EntityUid uid, InputMoverComponent component, ref ComponentGetState args)
private void OnMoverGetState(Entity<InputMoverComponent> entity, ref ComponentGetState args)
{
args.State = new InputMoverComponentState()
{
CanMove = component.CanMove,
RelativeEntity = GetNetEntity(component.RelativeEntity),
LerpTarget = component.LerpTarget,
HeldMoveButtons = component.HeldMoveButtons,
RelativeRotation = component.RelativeRotation,
TargetRelativeRotation = component.TargetRelativeRotation,
DefaultSprinting = component.DefaultSprinting
CanMove = entity.Comp.CanMove,
RelativeEntity = GetNetEntity(entity.Comp.RelativeEntity),
LerpTarget = entity.Comp.LerpTarget,
HeldMoveButtons = entity.Comp.HeldMoveButtons,
RelativeRotation = entity.Comp.RelativeRotation,
TargetRelativeRotation = entity.Comp.TargetRelativeRotation,
DefaultSprinting = entity.Comp.DefaultSprinting
};
}

@@ -152,9 +149,9 @@ private void ShutdownInput()

protected virtual void HandleShuttleInput(EntityUid uid, ShuttleButtons button, ushort subTick, bool state) {}

private void OnAutoParentChange(EntityUid uid, AutoOrientComponent component, ref EntParentChangedMessage args)
private void OnAutoParentChange(Entity<AutoOrientComponent> entity, ref EntParentChangedMessage args)
{
ResetCamera(uid);
ResetCamera(entity.Owner);
}

public void RotateCamera(EntityUid uid, Angle angle)
@@ -243,28 +240,28 @@ public Angle GetParentGridAngle(InputMoverComponent mover)
return rotation;
}

private void OnFollowedParentChange(EntityUid uid, FollowedComponent component, ref EntParentChangedMessage args)
private void OnFollowedParentChange(Entity<FollowedComponent> entity, ref EntParentChangedMessage args)
{
foreach (var foll in component.Following)
foreach (var foll in entity.Comp.Following)
{
if (!MoverQuery.TryGetComponent(foll, out var mover))
continue;

var ev = new EntParentChangedMessage(foll, null, args.OldMapId, XformQuery.GetComponent(foll));
OnInputParentChange(foll, mover, ref ev);
OnInputParentChange((foll, mover), ref ev);
}
}

private void OnInputParentChange(EntityUid uid, InputMoverComponent component, ref EntParentChangedMessage args)
private void OnInputParentChange(Entity<InputMoverComponent> entity, ref EntParentChangedMessage args)
{
// If we change our grid / map then delay updating our LastGridAngle.
var relative = args.Transform.GridUid;
relative ??= args.Transform.MapUid;

if (component.LifeStage < ComponentLifeStage.Running)
if (entity.Comp.LifeStage < ComponentLifeStage.Running)
{
component.RelativeEntity = relative;
Dirty(uid, component);
entity.Comp.RelativeEntity = relative;
Dirty(entity.Owner, entity.Comp);
return;
}

@@ -274,28 +271,28 @@ private void OnInputParentChange(EntityUid uid, InputMoverComponent component, r
// If we change maps then reset eye rotation entirely.
if (oldMapId != mapId)
{
component.RelativeEntity = relative;
component.TargetRelativeRotation = Angle.Zero;
component.RelativeRotation = Angle.Zero;
component.LerpTarget = TimeSpan.Zero;
Dirty(uid, component);
entity.Comp.RelativeEntity = relative;
entity.Comp.TargetRelativeRotation = Angle.Zero;
entity.Comp.RelativeRotation = Angle.Zero;
entity.Comp.LerpTarget = TimeSpan.Zero;
Dirty(entity.Owner, entity.Comp);
return;
}

// If we go on a grid and back off then just reset the accumulator.
if (relative == component.RelativeEntity)
if (relative == entity.Comp.RelativeEntity)
{
if (component.LerpTarget >= Timing.CurTime)
if (entity.Comp.LerpTarget >= Timing.CurTime)
{
component.LerpTarget = TimeSpan.Zero;
Dirty(uid, component);
entity.Comp.LerpTarget = TimeSpan.Zero;
Dirty(entity.Owner, entity.Comp);
}

return;
}

component.LerpTarget = TimeSpan.FromSeconds(InputMoverComponent.LerpTime) + Timing.CurTime;
Dirty(uid, component);
entity.Comp.LerpTarget = TimeSpan.FromSeconds(InputMoverComponent.LerpTime) + Timing.CurTime;
Dirty(entity.Owner, entity.Comp);
}

private void HandleDirChange(EntityUid entity, Direction dir, ushort subTick, bool state)
@@ -309,7 +306,7 @@ private void HandleDirChange(EntityUid entity, Direction dir, ushort subTick, bo
DebugTools.AssertNotNull(relayMover.RelayEntity);

if (MoverQuery.TryGetComponent(entity, out var mover))
SetMoveInput(mover, MoveButtons.None);
SetMoveInput((entity, mover), MoveButtons.None);

if (_mobState.IsDead(entity)
|| _mobState.IsCritical(entity) && !_configManager.GetCVar(CCVars.AllowMovementWhileCrit))
@@ -334,19 +331,19 @@ private void HandleDirChange(EntityUid entity, Direction dir, ushort subTick, bo
RaiseLocalEvent(xform.ParentUid, ref relayMoveEvent);
}

SetVelocityDirection(entity, moverComp, dir, subTick, state);
SetVelocityDirection((entity, moverComp), dir, subTick, state);
}

private void OnInputInit(EntityUid uid, InputMoverComponent component, ComponentInit args)
private void OnInputInit(Entity<InputMoverComponent> entity, ref ComponentInit args)
{
var xform = Transform(uid);
var xform = Transform(entity.Owner);

if (!xform.ParentUid.IsValid())
return;

component.RelativeEntity = xform.GridUid ?? xform.MapUid;
component.TargetRelativeRotation = Angle.Zero;
WalkingAlert(uid, component);
entity.Comp.RelativeEntity = xform.GridUid ?? xform.MapUid;
entity.Comp.TargetRelativeRotation = Angle.Zero;
WalkingAlert(entity);
}

private void HandleRunChange(EntityUid uid, ushort subTick, bool walking)
@@ -358,8 +355,8 @@ private void HandleRunChange(EntityUid uid, ushort subTick, bool walking)
// if we swap to relay then stop our existing input if we ever change back.
if (moverComp != null)
{
SetMoveInput(moverComp, MoveButtons.None);
WalkingAlert(uid, moverComp);
SetMoveInput((uid, moverComp), MoveButtons.None);
WalkingAlert((uid, moverComp));
}

HandleRunChange(relayMover.RelayEntity, subTick, walking);
@@ -368,7 +365,7 @@ private void HandleRunChange(EntityUid uid, ushort subTick, bool walking)

if (moverComp == null) return;

SetSprinting(uid, moverComp, subTick, walking);
SetSprinting((uid, moverComp), subTick, walking);
}

public (Vector2 Walking, Vector2 Sprinting) GetVelocityInput(InputMoverComponent mover)
@@ -419,7 +416,7 @@ private void HandleRunChange(EntityUid uid, ushort subTick, bool walking)
/// composed into a single direction vector, <see cref="VelocityDir"/>. Enabling
/// opposite directions will cancel each other out, resulting in no direction.
/// </summary>
public void SetVelocityDirection(EntityUid entity, InputMoverComponent component, Direction direction, ushort subTick, bool enabled)
public void SetVelocityDirection(Entity<InputMoverComponent> entity, Direction direction, ushort subTick, bool enabled)
{
// Logger.Info($"[{_gameTiming.CurTick}/{subTick}] {direction}: {enabled}");

@@ -432,26 +429,26 @@ public void SetVelocityDirection(EntityUid entity, InputMoverComponent component
_ => throw new ArgumentException(nameof(direction))
};

SetMoveInput(entity, component, subTick, enabled, bit);
SetMoveInput(entity, subTick, enabled, bit);
}

private void SetMoveInput(EntityUid entity, InputMoverComponent component, ushort subTick, bool enabled, MoveButtons bit)
private void SetMoveInput(Entity<InputMoverComponent> entity, ushort subTick, bool enabled, MoveButtons bit)
{
// Modifies held state of a movement button at a certain sub tick and updates current tick movement vectors.
ResetSubtick(component);
ResetSubtick(entity.Comp);

if (subTick >= component.LastInputSubTick)
if (subTick >= entity.Comp.LastInputSubTick)
{
var fraction = (subTick - component.LastInputSubTick) / (float) ushort.MaxValue;
var fraction = (subTick - entity.Comp.LastInputSubTick) / (float) ushort.MaxValue;

ref var lastMoveAmount = ref component.Sprinting ? ref component.CurTickSprintMovement : ref component.CurTickWalkMovement;
ref var lastMoveAmount = ref entity.Comp.Sprinting ? ref entity.Comp.CurTickSprintMovement : ref entity.Comp.CurTickWalkMovement;

lastMoveAmount += DirVecForButtons(component.HeldMoveButtons) * fraction;
lastMoveAmount += DirVecForButtons(entity.Comp.HeldMoveButtons) * fraction;

component.LastInputSubTick = subTick;
entity.Comp.LastInputSubTick = subTick;
}

var buttons = component.HeldMoveButtons;
var buttons = entity.Comp.HeldMoveButtons;

if (enabled)
{
@@ -462,7 +459,7 @@ private void SetMoveInput(EntityUid entity, InputMoverComponent component, ushor
buttons &= ~bit;
}

SetMoveInput(component, buttons);
SetMoveInput(entity, buttons);
}

private void ResetSubtick(InputMoverComponent component)
@@ -475,12 +472,12 @@ private void ResetSubtick(InputMoverComponent component)
component.LastInputSubTick = 0;
}


public void SetSprinting(EntityUid entity, InputMoverComponent component, ushort subTick, bool walking)
public void SetSprinting(Entity<InputMoverComponent> entity, ushort subTick, bool walking)
{
// Logger.Info($"[{_gameTiming.CurTick}/{subTick}] Sprint: {enabled}");
SetMoveInput(entity, component, subTick, walking, MoveButtons.Walk);
WalkingAlert(entity, component);

SetMoveInput(entity, subTick, walking, MoveButtons.Walk);
WalkingAlert(entity);
}

/// <summary>
32 changes: 16 additions & 16 deletions Content.Shared/Movement/Systems/SharedMoverController.Relay.cs
Original file line number Diff line number Diff line change
@@ -12,14 +12,14 @@ private void InitializeRelay()
SubscribeLocalEvent<RelayInputMoverComponent, AfterAutoHandleStateEvent>(OnAfterRelayState);
}

private void OnAfterRelayTargetState(EntityUid uid, MovementRelayTargetComponent component, ref AfterAutoHandleStateEvent args)
private void OnAfterRelayTargetState(Entity<MovementRelayTargetComponent> entity, ref AfterAutoHandleStateEvent args)
{
Physics.UpdateIsPredicted(uid);
Physics.UpdateIsPredicted(entity.Owner);
}

private void OnAfterRelayState(EntityUid uid, RelayInputMoverComponent component, ref AfterAutoHandleStateEvent args)
private void OnAfterRelayState(Entity<RelayInputMoverComponent> entity, ref AfterAutoHandleStateEvent args)
{
Physics.UpdateIsPredicted(uid);
Physics.UpdateIsPredicted(entity.Owner);
}

/// <summary>
@@ -61,30 +61,30 @@ public void SetRelay(EntityUid uid, EntityUid relayEntity)
Dirty(relayEntity, targetComp);
}

private void OnRelayShutdown(EntityUid uid, RelayInputMoverComponent component, ComponentShutdown args)
private void OnRelayShutdown(Entity<RelayInputMoverComponent> entity, ref ComponentShutdown args)
{
Physics.UpdateIsPredicted(uid);
Physics.UpdateIsPredicted(component.RelayEntity);
Physics.UpdateIsPredicted(entity.Owner);
Physics.UpdateIsPredicted(entity.Comp.RelayEntity);

if (TryComp<InputMoverComponent>(component.RelayEntity, out var inputMover))
SetMoveInput(inputMover, MoveButtons.None);
if (TryComp<InputMoverComponent>(entity.Comp.RelayEntity, out var inputMover))
SetMoveInput((entity.Comp.RelayEntity, inputMover), MoveButtons.None);

if (Timing.ApplyingState)
return;

if (TryComp(component.RelayEntity, out MovementRelayTargetComponent? target) && target.LifeStage <= ComponentLifeStage.Running)
RemComp(component.RelayEntity, target);
if (TryComp(entity.Comp.RelayEntity, out MovementRelayTargetComponent? target) && target.LifeStage <= ComponentLifeStage.Running)
RemComp(entity.Comp.RelayEntity, target);
}

private void OnTargetRelayShutdown(EntityUid uid, MovementRelayTargetComponent component, ComponentShutdown args)
private void OnTargetRelayShutdown(Entity<MovementRelayTargetComponent> entity, ref ComponentShutdown args)
{
Physics.UpdateIsPredicted(uid);
Physics.UpdateIsPredicted(component.Source);
Physics.UpdateIsPredicted(entity.Owner);
Physics.UpdateIsPredicted(entity.Comp.Source);

if (Timing.ApplyingState)
return;

if (TryComp(component.Source, out RelayInputMoverComponent? relay) && relay.LifeStage <= ComponentLifeStage.Running)
RemComp(component.Source, relay);
if (TryComp(entity.Comp.Source, out RelayInputMoverComponent? relay) && relay.LifeStage <= ComponentLifeStage.Running)
RemComp(entity.Comp.Source, relay);
}
}
4 changes: 2 additions & 2 deletions Content.Shared/Movement/Systems/SharedMoverController.cs
Original file line number Diff line number Diff line change
@@ -295,9 +295,9 @@ protected void HandleMobMovement(
PhysicsSystem.SetAngularVelocity(physicsUid, 0, body: physicsComponent);
}

private void WalkingAlert(EntityUid player, InputMoverComponent component)
private void WalkingAlert(Entity<InputMoverComponent> entity)
{
_alerts.ShowAlert(player, component.WalkingAlert, component.Sprinting ? (short) 1 : (short) 0);
_alerts.ShowAlert(entity, entity.Comp.WalkingAlert, component.Sprinting ? (short) 1 : (short) 0);
}

public void LerpRotation(EntityUid uid, InputMoverComponent mover, float frameTime)