Skip to content

Commit

Permalink
Pawn first move bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Cap. Hindsight committed Mar 1, 2017
1 parent 0cec226 commit e40da03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Kernel/Chess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ private bool CheckIntermediateSquares(Piece piece, Position source, Position tar
switch (piece.Player) {
case Player.White:
if (!capture)
return source.X == target.X && (source.Y + 1 == target.Y || source.Y == 1 && target.Y == 3);
return source.X == target.X && (source.Y + 1 == target.Y || source.Y == 1 && target.Y == 3 && this[source.X, 2] == null);
else
return (source.X == target.X + 1 || source.X + 1 == target.X) && source.Y + 1 == target.Y;
case Player.Black:
if (!capture)
return source.X == target.X && (source.Y - 1 == target.Y || source.Y == 6 && target.Y == 4);
return source.X == target.X && (source.Y - 1 == target.Y || source.Y == 6 && target.Y == 4 && this[source.X, 5] == null);
else
return (source.X == target.X + 1 || source.X + 1 == target.X) && source.Y - 1 == target.Y;
default:
Expand Down

0 comments on commit e40da03

Please sign in to comment.