Squash ApplyLinearImpulse into SetLinearVelocity in RandomWalkController.cs (#31293)

* Squash ApplyLinearImpulse into SetLinearVelocity in RandomWalkController

* Late night code
This commit is contained in:
Winkarst
2024-08-22 12:17:37 +03:00
committed by GitHub
parent 804b7431c2
commit 5139ecdbd2

View File

@@ -77,8 +77,7 @@ internal sealed class RandomWalkController : VirtualController
randomWalk.BiasVector *= 0f;
var pushStrength = _random.NextFloat(randomWalk.MinSpeed, randomWalk.MaxSpeed);
_physics.SetLinearVelocity(uid, physics.LinearVelocity * randomWalk.AccumulatorRatio, body: physics);
_physics.ApplyLinearImpulse(uid, pushVec * (pushStrength * physics.Mass), body: physics);
_physics.SetLinearVelocity(uid, physics.LinearVelocity * randomWalk.AccumulatorRatio + pushVec * pushStrength, body: physics);
}
/// <summary>