Fix thrusters (#24446)

This commit is contained in:
metalgearsloth
2024-01-23 23:49:19 +11:00
committed by GitHub
parent 05a7eb07c2
commit 9e0bdcd8d8
2 changed files with 2 additions and 8 deletions

View File

@@ -249,8 +249,8 @@ namespace Content.Server.Physics.Controllers
var horizIndex = vel.X > 0 ? 1 : 3; // east else west var horizIndex = vel.X > 0 ? 1 : 3; // east else west
var vertIndex = vel.Y > 0 ? 2 : 0; // north else south var vertIndex = vel.Y > 0 ? 2 : 0; // north else south
var horizComp = vel.X != 0 ? MathF.Pow(Vector2.Dot(vel, new (shuttle.BaseLinearThrust[horizIndex] / shuttle.LinearThrust[horizIndex], 0f)), 2) : 0; var horizComp = vel.X != 0 ? MathF.Pow(Vector2.Dot(vel, new (shuttle.LinearThrust[horizIndex] / shuttle.LinearThrust[horizIndex], 0f)), 2) : 0;
var vertComp = vel.Y != 0 ? MathF.Pow(Vector2.Dot(vel, new (0f, shuttle.BaseLinearThrust[vertIndex] / shuttle.LinearThrust[vertIndex])), 2) : 0; var vertComp = vel.Y != 0 ? MathF.Pow(Vector2.Dot(vel, new (0f, shuttle.LinearThrust[vertIndex] / shuttle.LinearThrust[vertIndex])), 2) : 0;
return shuttle.BaseMaxLinearVelocity * vel * MathF.ReciprocalSqrtEstimate(horizComp + vertComp); return shuttle.BaseMaxLinearVelocity * vel * MathF.ReciprocalSqrtEstimate(horizComp + vertComp);
} }

View File

@@ -30,12 +30,6 @@ namespace Content.Server.Shuttles.Components
[ViewVariables] [ViewVariables]
public readonly float[] LinearThrust = new float[4]; public readonly float[] LinearThrust = new float[4];
/// <summary>
/// The cached thrust available for each cardinal direction, if all thrusters are T1
/// </summary>
[ViewVariables]
public readonly float[] BaseLinearThrust = new float[4];
/// <summary> /// <summary>
/// The thrusters contributing to each direction for impulse. /// The thrusters contributing to each direction for impulse.
/// </summary> /// </summary>