From 86b9aca987bd34448c85d7a5ae1538f2f73bb5b8 Mon Sep 17 00:00:00 2001 From: Shivkumar Shivaji Date: Mon, 23 Dec 2013 21:04:19 -0800 Subject: [PATCH] Enpassant bug fix --- libchess/position.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libchess/position.cc b/libchess/position.cc index 0ebc6730b..595f8d3de 100644 --- a/libchess/position.cc +++ b/libchess/position.cc @@ -244,8 +244,8 @@ Square Position::get_real_ep_square() const { const int offsets[] = { 17, 15 }; for (int i = 0; i < 2; i++) { int offset = (m_turn == 'w') ? offsets[i] : - offsets[i]; - if (m_board[offset].is_valid() && m_board[offset].type() == 'p' && - m_board[offset].color() == m_turn) { + if (m_board[ep_square.x88_index()+offset].is_valid() && m_board[ep_square.x88_index()+offset].type() == 'p' && + m_board[ep_square.x88_index()+offset].color() == m_turn) { return ep_square; } } @@ -1266,7 +1266,7 @@ MoveInfo Position::make_move(const Move& move) { } if (info.is_enpassant()) { - info.set_san(info.san() + " (e.p.)"); + info.set_san(info.san() + " e.p."); } return info;