diff --git a/Server/src/SOR.Game/GameEngine.cs b/Server/src/SOR.Game/GameEngine.cs index 8576f50..f62ad42 100644 --- a/Server/src/SOR.Game/GameEngine.cs +++ b/Server/src/SOR.Game/GameEngine.cs @@ -374,10 +374,16 @@ public static class GameEngine if (board.GetTile(t) is null) throw new GameException("TILE_OUT_OF_BOUNDS"); - // Di/Tri: each subsequent tile must be orthogonally adjacent to the previous. + // Di/Tri: each subsequent tile must be adjacent to the previous. + // Hex boards use cube-metric distance 1; square boards use Manhattan distance 1. for (int i = 1; i < targetTiles.Count; i++) - if (!targetTiles[i].IsOrthogonallyAdjacentTo(targetTiles[i - 1])) + { + bool adjacent = board.HexSides > 0 + ? HexGrid.Distance(targetTiles[i], targetTiles[i - 1], board.HexSides) == 1 + : targetTiles[i].IsOrthogonallyAdjacentTo(targetTiles[i - 1]); + if (!adjacent) throw new GameException("TILES_NOT_ADJACENT"); + } player.Hand.Remove(card); player.CurrentSp -= card.SpCost;