Entity.Acceleration puts back what a VelocityLimit removed: the ceiling is not a change of vector

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-07 05:39:40 +02:00
commit 2cf980e353
2 changed files with 12 additions and 2 deletions

View file

@ -29,6 +29,11 @@ public abstract class Entity
public float2 Acceleration;
public ManoeuvreTrack Manoeuvre;
// The planar velocity a VelocityLimit removed during the current base update. A limit is the ship's ceiling, not a
// change of vector the pilot made, so Acceleration reads the velocity change with this put back. VelocityLimit is
// the one writer, Entity.Update zeroes it, and it is never saved.
public float2 LimitClamp;
public float[,] Temperature;
public float[,] NewTemperature;
public bool2[,] HullConductivity;
@ -1350,6 +1355,7 @@ public abstract class Entity
if (!_active) return;
var velocityBefore = Velocity;
LimitClamp = float2(0, 0);
var hullData = ItemManager.GetData(Hull) as HullData;
// Mining Cut 3: a chunk target is lost the moment this entity can no longer see it -- the lost-track rule
@ -1466,7 +1472,7 @@ public abstract class Entity
}
else Position.y = Zone.GetHeight(Position.xz) + hullData.GridOffset;
Acceleration = delta > 0f ? (Velocity - velocityBefore) / delta : float2(0, 0);
Acceleration = delta > 0f ? (Velocity + LimitClamp - velocityBefore) / delta : float2(0, 0);
Manoeuvre.Observe(Acceleration, delta, ItemManager.GameplaySettings.SolutionWindow);
}