AI aim and turret aim ride Entity.RideHeight; tests pin the hull GridOffset on a slope and at both aim sites

Combat and TurretController spelled GetHeight + GridOffset inline; they call target.RideHeight now. The drawn-ship test authors a hull with GridOffset 2.5 on the well's slope. Two new tests aim at a target hull raised 40 u.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-15 18:39:28 +02:00
commit 4bac2623bf
4 changed files with 44 additions and 11 deletions

View file

@ -64,13 +64,12 @@ public class TurretController : Behavior, IInitializableBehavior
var diff = target.Position - Entity.Position;
if (_predictShots)
{
var targetHullData = Entity.ItemManager.GetData(target.Hull) as HullData;
var targetVelocity = float3(target.Velocity.x, 0, target.Velocity.y);
var predictedPosition = first_order_intercept(
Entity.Position, float3.zero, _shotSpeed,
target.Position, targetVelocity
);
predictedPosition.y = Entity.Zone.GetHeight(predictedPosition.xz) + targetHullData.GridOffset;
predictedPosition.y = target.RideHeight(predictedPosition.xz);
Entity.Aim = normalize(predictedPosition - Entity.Position);
}
else