]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Squash ApplyLinearImpulse into SetLinearVelocity in RandomWalkController.cs (#31293)
authorWinkarst <74284083+Winkarst-cpu@users.noreply.github.com>
Thu, 22 Aug 2024 09:17:37 +0000 (12:17 +0300)
committerGitHub <noreply@github.com>
Thu, 22 Aug 2024 09:17:37 +0000 (11:17 +0200)
* Squash ApplyLinearImpulse into SetLinearVelocity in RandomWalkController

* Late night code

Content.Server/Physics/Controllers/RandomWalkController.cs

index 61d393c488dd84be7407c7ca0d35b9be9c6f5c27..55d3d50d2a5c053dddca3ad61b0e88936a6ab548 100644 (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>