Rev 63 | Rev 65 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 63 | Rev 64 | ||
---|---|---|---|
Line 132... | Line 132... | ||
132 | } |
132 | } |
133 | 133 | ||
134 | // read the part's type |
134 | // read the part's type |
135 | if (fieldstop >= fieldstart) |
135 | if (fieldstop >= fieldstart) |
136 | { |
136 | { |
137 | if (towupper (new_move->pgntext[fieldstop]) == L'R') |
137 | if (towupper (new_move->pgntext[fieldstop]) == L'R') new_move->part = PART_ROOK; // it's a rook |
138 | new_move->part = PART_ROOK; // it's a rook |
- | |
139 | else if (towupper (new_move->pgntext[fieldstop]) == L'N') |
138 | else if (towupper (new_move->pgntext[fieldstop]) == L'N') new_move->part = PART_KNIGHT; // it's a knight |
140 | new_move->part = PART_KNIGHT; // it's a knight |
- | |
141 | else if (towupper (new_move->pgntext[fieldstop]) == L'B') |
139 | else if (towupper (new_move->pgntext[fieldstop]) == L'B') new_move->part = PART_BISHOP; // it's a bishop |
142 | new_move->part = PART_BISHOP; // it's a bishop |
- | |
143 | else if (towupper (new_move->pgntext[fieldstop]) == L'Q') |
140 | else if (towupper (new_move->pgntext[fieldstop]) == L'Q') new_move->part = PART_QUEEN; // it's a queen |
144 | new_move->part = PART_QUEEN; // it's a queen |
- | |
145 | else if (towupper (new_move->pgntext[fieldstop]) == L'K') |
141 | else if (towupper (new_move->pgntext[fieldstop]) == L'K') new_move->part = PART_KING; // it's a king |
146 |
|
142 | else if (towupper (new_move->pgntext[fieldstop]) == L'P') new_move->part = PART_PAWN; // it's a pawn (Wikipedia says "P" is a valid part type in PGN texts...) |
147 | else |
- | |
148 |
|
143 | else return (false); // on error, cancel |
149 | } |
144 | } |
150 | else |
145 | else |
151 | new_move->part = PART_PAWN; // if not specified, it's a pawn |
146 | new_move->part = PART_PAWN; // if not specified, it's a pawn |
152 | } |
147 | } |
153 | 148 |