diff options
| author | Franklin Wei <me@fwei.tk> | 2017-05-28 17:40:43 -0400 |
|---|---|---|
| committer | Franklin Wei <me@fwei.tk> | 2017-05-28 17:40:43 -0400 |
| commit | 988afccc360e6e1e22161ccc63518fc253c6b1f7 (patch) | |
| tree | 928280d5491753a1537c4e5a4f809d3bbd110afa | |
| parent | 0bbdcc8bd920421b19f4d25d416d8c3f1ae13cda (diff) | |
| download | xenonchess-988afccc360e6e1e22161ccc63518fc253c6b1f7.zip xenonchess-988afccc360e6e1e22161ccc63518fc253c6b1f7.tar.gz xenonchess-988afccc360e6e1e22161ccc63518fc253c6b1f7.tar.bz2 xenonchess-988afccc360e6e1e22161ccc63518fc253c6b1f7.tar.xz | |
fix en passant bug
| -rw-r--r-- | chess.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -546,12 +546,12 @@ void for_each_move(const struct chess_ctx *ctx, int opp = piece->color == WHITE ? 1 : 0; if(valid_coords(y + dy, x + 1) && ctx->en_passant[opp][x + 1]) { - if(!gen_and_call(ctx, y + dy, x, dy, 1, cb, data, enforce_check)) + if(!gen_and_call(ctx, y, x, dy, 1, cb, data, enforce_check)) return; } if(valid_coords(y + dy, x - 1) && ctx->en_passant[opp][x - 1]) { - if(!gen_and_call(ctx, y + dy, x, dy, -1, cb, data, enforce_check)) + if(!gen_and_call(ctx, y, x, dy, -1, cb, data, enforce_check)) return; } } |