From cb56557b4d8c56f385e270352faf26001f64d249 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 7 Oct 2026 04:38:36 +0200 Subject: [PATCH] Boss gate tests: the gate geometry test places the exit zone away from the origin Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/RunGoalTests.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/RunGoalTests.cs b/tests/Aetheria.Shared.Tests/RunGoalTests.cs index 8e75fef90..b910f768b 100644 --- a/tests/Aetheria.Shared.Tests/RunGoalTests.cs +++ b/tests/Aetheria.Shared.Tests/RunGoalTests.cs @@ -202,16 +202,19 @@ public sealed partial class RunStartTests var zone = ZoneOf(galaxy, galaxy.Exit); const float ratio = 0.75f; var radius = zone.Pack.Radius * ratio; - var origin = galaxy.Exit.Position; + // Away from the origin and with close neighbours, so a direction taken from raw positions instead of the + // offset from the zone cannot pass. + var originalPosition = galaxy.Exit.Position; + var origin = galaxy.Exit.Position = math.float2(500, -300); var original = galaxy.Exit.AdjacentZones; galaxy.Exit.AdjacentZones = neighbourDegrees .Select(degrees => new GalaxyZone { - Position = origin + math.float2((float) Math.Cos(degrees * Math.PI / 180), (float) Math.Sin(degrees * Math.PI / 180)) * 1000 + Position = origin + math.float2((float) Math.Cos(degrees * Math.PI / 180), (float) Math.Sin(degrees * Math.PI / 180)) * 10 }).ToList(); float2 gate; try { gate = RunGoal.ExitGatePosition(zone, ratio); } - finally { galaxy.Exit.AdjacentZones = original; } + finally { galaxy.Exit.AdjacentZones = original; galaxy.Exit.Position = originalPosition; } Assert.Equal(radius, math.length(gate), 2); if (neighbourDegrees.Length == 0) { Assert.Equal(radius, gate.x, 2); Assert.Equal(0, gate.y, 2); return; }