Fri, 24 Jul 2026 12:53:58 +0200
fix: disambiguation by row while capturing was not implemented
fixes #934
| src/chess/rules.c | file | annotate | diff | comparison | revisions |
--- a/src/chess/rules.c Fri Jul 24 12:44:42 2026 +0200 +++ b/src/chess/rules.c Fri Jul 24 12:53:58 2026 +0200 @@ -804,8 +804,14 @@ if (mstr[2] == 'x') { move->capture = 1; if (move->piece) { - /* capture (e.g. "Ndxf3") */ - move->fromfile = fileidx(mstr[1]); + /* capture (e.g. "Ndxf3" or "R1xh3") */ + if (isfile(mstr[1])) { + move->fromfile = fileidx(mstr[1]); + } else if (isrow(mstr[1])) { + move->fromrow = rowidx(mstr[1]); + } else { + return INVALID_MOVE_SYNTAX; + } } else { /* long notation capture (e.g. "e5xf6") */ move->piece = PAWN;