src/rules/pawn.c

changeset 15
7ffd66591afe
parent 14
970748b9a73b
child 16
a298c6637c30
equal deleted inserted replaced
14:970748b9a73b 15:7ffd66591afe
33 int8_t d = ((move->piece & COLOR_MASK) == WHITE ? -1 : 1); 33 int8_t d = ((move->piece & COLOR_MASK) == WHITE ? -1 : 1);
34 if (move->capture) { 34 if (move->capture) {
35 if (move->fromrow == move->torow + d && ( 35 if (move->fromrow == move->torow + d && (
36 move->fromfile == move->tofile + 1 || 36 move->fromfile == move->tofile + 1 ||
37 move->fromfile == move->tofile - 1)) { 37 move->fromfile == move->tofile - 1)) {
38 // TODO: en passant 38
39 return mdst(board,move) != 0; /* color has been checked */ 39 return mdst(board,move)
40 || (board[move->fromrow][move->tofile] & ENPASSANT_THREAT);
40 } else { 41 } else {
41 return FALSE; 42 return FALSE;
42 } 43 }
43 } else { 44 } else {
44 if (move->fromfile == move->tofile) { 45 if (move->fromfile == move->tofile) {

mercurial