Update CloseTo to CloseToPercent (#4708)

This commit is contained in:
metalgearsloth
2021-09-29 20:07:01 +10:00
committed by GitHub
parent fe4a415d3b
commit ad783396f8
18 changed files with 31 additions and 31 deletions

View File

@@ -105,6 +105,11 @@ namespace Content.Server.Physics.Controllers
// ShuttleSystem has already worked out the ratio so we'll just multiply it back by the mass.
var movement = (mover.VelocityDir.walking + mover.VelocityDir.sprinting);
if (physicsComponent.LinearVelocity.LengthSquared == 0f)
{
movement *= 5f;
}
switch (shuttleComponent.Mode)
{
case ShuttleMode.Docking:
@@ -137,12 +142,6 @@ namespace Content.Server.Physics.Controllers
var velocity = physicsComponent.LinearVelocity;
if (velocity.Length < 0.1f && movement.Length == 0f)
{
physicsComponent.LinearVelocity = Vector2.Zero;
return;
}
if (velocity.Length > speedCap)
{
physicsComponent.LinearVelocity = velocity.Normalized * speedCap;