diff --git a/src/GameLogic/MiniGames/HeykelSavasiContext.cs b/src/GameLogic/MiniGames/HeykelSavasiContext.cs index f432802..88c1b4a 100644 --- a/src/GameLogic/MiniGames/HeykelSavasiContext.cs +++ b/src/GameLogic/MiniGames/HeykelSavasiContext.cs @@ -233,11 +233,19 @@ public class HeykelSavasiContext : MiniGameContext /// public ExitGate GetTeamSpawnGate(HeykelSavasiTeam team) { - var (anchorX1, anchorY1) = team == HeykelSavasiTeam.Blue - ? (BlueBaseAnchorX1, BlueBaseAnchorY1) - : (RedBaseAnchorX1, RedBaseAnchorY1); + // Robust selection: the map has exactly two spawn gates (one per base). The red base sits at + // the top of the arena (smaller Y), the blue base at the bottom (larger Y). Selecting by Y-order + // avoids brittle exact-coordinate matching (gate coords can drift by a tile between data paths). + var spawnGates = this.Definition.Entrance!.Map!.ExitGates + .Where(g => g.IsSpawnGate) + .OrderBy(g => g.Y1) + .ToList(); + if (spawnGates.Count == 0) + { + return this.Definition.Entrance!; + } - return this.Definition.Entrance!.Map!.ExitGates.First(g => g.X1 == anchorX1 && g.Y1 == anchorY1); + return team == HeykelSavasiTeam.Blue ? spawnGates[^1] : spawnGates[0]; } ///