| 802 } else { |
802 } else { |
| 803 move->piece = getpiece(mstr[0]); |
803 move->piece = getpiece(mstr[0]); |
| 804 if (mstr[2] == 'x') { |
804 if (mstr[2] == 'x') { |
| 805 move->capture = 1; |
805 move->capture = 1; |
| 806 if (move->piece) { |
806 if (move->piece) { |
| 807 /* capture (e.g. "Ndxf3") */ |
807 /* capture (e.g. "Ndxf3" or "R1xh3") */ |
| 808 move->fromfile = fileidx(mstr[1]); |
808 if (isfile(mstr[1])) { |
| |
809 move->fromfile = fileidx(mstr[1]); |
| |
810 } else if (isrow(mstr[1])) { |
| |
811 move->fromrow = rowidx(mstr[1]); |
| |
812 } else { |
| |
813 return INVALID_MOVE_SYNTAX; |
| |
814 } |
| 809 } else { |
815 } else { |
| 810 /* long notation capture (e.g. "e5xf6") */ |
816 /* long notation capture (e.g. "e5xf6") */ |
| 811 move->piece = PAWN; |
817 move->piece = PAWN; |
| 812 move->fromfile = fileidx(mstr[0]); |
818 move->fromfile = fileidx(mstr[0]); |
| 813 move->fromrow = rowidx(mstr[1]); |
819 move->fromrow = rowidx(mstr[1]); |