| 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 */ |