diff --git a/src/ChessArbiter.cpp b/src/ChessArbiter.cpp index a6dddf3..30fc078 100644 --- a/src/ChessArbiter.cpp +++ b/src/ChessArbiter.cpp @@ -531,7 +531,7 @@ std::string ChessArbiter::ParseSAN(const std::string &SANMove) { } char ChessArbiter::ParseSANPromotion(const std::string &SANMove){ - if(SANMove.length()>=4 && SANMove[0] - 'a' < 8 && SANMove[2]=='='){ + if(SANMove.length()>=4 && SANMove[2]=='='){ char p=SANMove[3]; // Must be upper if(p=='Q' || p=='R' || p=='B' || p=='N'){ return p; diff --git a/tests/chessarbiter.cpp b/tests/chessarbiter.cpp index 96b5f3b..2b6bdec 100644 --- a/tests/chessarbiter.cpp +++ b/tests/chessarbiter.cpp @@ -496,6 +496,10 @@ TEST_CASE("Specific bugs found on a game", "[BugFixes]") { CHECK(p == 'N'); p=a.ParseSANPromotion("d8=B+"); CHECK(p == 'B'); - p=a.ParseSANPromotion("d8=R"); + p=a.ParseSANPromotion("h1=R"); + CHECK(p == 'R'); + p=a.ParseSANPromotion("a1=R"); + CHECK(p == 'R'); + p=a.ParseSANPromotion("c1=R"); CHECK(p == 'R'); } \ No newline at end of file