src/chess/pgn.c

changeset 163
2a6d83f4677e
parent 150
7d57a252948e
equal deleted inserted replaced
162:f0fc70b6f8f9 163:2a6d83f4677e
145 if (i >= 10) { 145 if (i >= 10) {
146 return(pgn_error_move_syntax); 146 return(pgn_error_move_syntax);
147 } 147 }
148 } while (!isspace(c = *(pgndata++))); 148 } while (!isspace(c = *(pgndata++)));
149 movestr[i] = '\0'; 149 movestr[i] = '\0';
150 if (eval_move(gamestate, movestr, &move, curcol) 150 if (eval_move(gamestate, movestr, curcol, &move)
151 != VALID_MOVE_SYNTAX) { 151 != VALID_MOVE_SYNTAX) {
152 return(pgn_error_move_syntax); 152 return(pgn_error_move_syntax);
153 } 153 }
154 if (validate_move(gamestate, &move) != VALID_MOVE_SEMANTICS) { 154 int move_validate_result = validate_move(gamestate, &move);
155 if (move_validate_result != VALID_MOVE_SEMANTICS) {
155 return(pgn_error_move_semantics); 156 return(pgn_error_move_semantics);
156 } 157 }
157 apply_move(gamestate, &move); 158 apply_move(gamestate, &move);
158 159
159 /* skip spaces */ 160 /* skip spaces */

mercurial