Skip to content

Commit

Permalink
fixed line attack stuck in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
triktron committed Jan 11, 2021
1 parent a369e85 commit ec1de75
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override List<Tile> Action(Board<Modals.Piece> board, Modals.Piece piece,
var playerTile = board.TileOf(piece);
var dir = playerTile.Position - tile.Position;
dir = new CubicHexCoord(Mathf.Clamp(dir.x, -1, 1), Mathf.Clamp(dir.y, -1, 1), Mathf.Clamp(dir.z, -1, 1));

if (dir.Equals(new CubicHexCoord())) return new List<Tile>();

var validTiles = new MovementHelper(board, piece)
.Collect(dir)
Expand Down

0 comments on commit ec1de75

Please sign in to comment.