From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Wed, 8 May 2024 10:22:09 +0000 (-0700) Subject: Move step sound distance and footstep variation to MobMoverComponent (#27799) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=401350759cd6486afa577c12b4536f39491b5254;p=space-station-14.git Move step sound distance and footstep variation to MobMoverComponent (#27799) --- diff --git a/Content.Shared/Movement/Components/MobMoverComponent.cs b/Content.Shared/Movement/Components/MobMoverComponent.cs index a77f415b93..7ad7961ed7 100644 --- a/Content.Shared/Movement/Components/MobMoverComponent.cs +++ b/Content.Shared/Movement/Components/MobMoverComponent.cs @@ -14,6 +14,15 @@ namespace Content.Shared.Movement.Components [DataField] public float PushStrength = 600f; + [DataField, AutoNetworkedField] + public float StepSoundMoveDistanceRunning = 2; + + [DataField, AutoNetworkedField] + public float StepSoundMoveDistanceWalking = 1.5f; + + [DataField, AutoNetworkedField] + public float FootstepVariation; + [ViewVariables(VVAccess.ReadWrite)] public EntityCoordinates LastPosition { get; set; } diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 92b953aca9..68e384a1b4 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -58,11 +58,6 @@ namespace Content.Shared.Movement.Systems protected EntityQuery CanMoveInAirQuery; protected EntityQuery NoRotateQuery; - private const float StepSoundMoveDistanceRunning = 2; - private const float StepSoundMoveDistanceWalking = 1.5f; - - private const float FootstepVariation = 0f; - /// /// /// @@ -258,7 +253,7 @@ namespace Content.Shared.Movement.Systems var audioParams = sound.Params .WithVolume(sound.Params.Volume + soundModifier) - .WithVariation(sound.Params.Variation ?? FootstepVariation); + .WithVariation(sound.Params.Variation ?? mobMover.FootstepVariation); // If we're a relay target then predict the sound for all relays. if (relayTarget != null) @@ -404,7 +399,9 @@ namespace Content.Shared.Movement.Systems return false; var coordinates = xform.Coordinates; - var distanceNeeded = mover.Sprinting ? StepSoundMoveDistanceRunning : StepSoundMoveDistanceWalking; + var distanceNeeded = mover.Sprinting + ? mobMover.StepSoundMoveDistanceRunning + : mobMover.StepSoundMoveDistanceWalking; // Handle footsteps. if (!weightless)