moves magic number from SharedMoverController to InputMoverComponent (#40411)

This commit is contained in:
Lordbrandon12
2025-09-20 15:35:07 -03:00
committed by GitHub
parent 63c468d963
commit 365d12a4e9
2 changed files with 4 additions and 1 deletions

View File

@@ -76,6 +76,8 @@ namespace Content.Shared.Movement.Components
public TimeSpan LerpTarget; public TimeSpan LerpTarget;
public const float LerpTime = 1.0f; public const float LerpTime = 1.0f;
public const float SprintingSoundModifier = 3.5f;
public const float WalkingSoundModifier = 1.5f;
public bool Sprinting => (HeldMoveButtons & MoveButtons.Walk) == 0x0; public bool Sprinting => (HeldMoveButtons & MoveButtons.Walk) == 0x0;

View File

@@ -331,7 +331,8 @@ public abstract partial class SharedMoverController : VirtualController
if (!weightless && MobMoverQuery.TryGetComponent(uid, out var mobMover) && if (!weightless && MobMoverQuery.TryGetComponent(uid, out var mobMover) &&
TryGetSound(weightless, uid, mover, mobMover, xform, out var sound, tileDef: tileDef)) TryGetSound(weightless, uid, mover, mobMover, xform, out var sound, tileDef: tileDef))
{ {
var soundModifier = mover.Sprinting ? 3.5f : 1.5f; var soundModifier = mover.Sprinting ? InputMoverComponent.SprintingSoundModifier
: InputMoverComponent.WalkingSoundModifier;
var audioParams = sound.Params var audioParams = sound.Params
.WithVolume(sound.Params.Volume + soundModifier) .WithVolume(sound.Params.Volume + soundModifier)