Prevent brains from walking (#15709)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2023-04-29 18:35:28 +12:00
committed by GitHub
parent 56f618e9ff
commit aeebe282d4
12 changed files with 50 additions and 61 deletions

View File

@@ -311,11 +311,11 @@ public partial class SharedBodySystem
var acceleration = 0f;
foreach (var leg in allLegs)
{
if (!TryComp<MovementSpeedModifierComponent>(leg, out var legModifier))
if (!TryComp<MovementBodyPartComponent>(leg, out var legModifier))
continue;
walkSpeed += legModifier.BaseWalkSpeed;
sprintSpeed += legModifier.BaseSprintSpeed;
walkSpeed += legModifier.WalkSpeed;
sprintSpeed += legModifier.SprintSpeed;
acceleration += legModifier.Acceleration;
}

View File

@@ -0,0 +1,14 @@
namespace Content.Shared.Movement.Components;
[RegisterComponent, NetworkedComponent]
public sealed class MovementBodyPartComponent : Component
{
[DataField("walkSpeed")]
public readonly float WalkSpeed = MovementSpeedModifierComponent.DefaultBaseWalkSpeed;
[DataField("sprintSpeed")]
public readonly float SprintSpeed = MovementSpeedModifierComponent.DefaultBaseSprintSpeed;
[DataField("acceleration")]
public float Acceleration = MovementSpeedModifierComponent.DefaultAcceleration;
}