| 290 gamestate->move_start = 2*mnr - 1; |
290 gamestate->move_start = 2*mnr - 1; |
| 291 if (white_to_move) gamestate->move_start--; |
291 if (white_to_move) gamestate->move_start--; |
| 292 |
292 |
| 293 /* only copy the fen string if everything is a success */ |
293 /* only copy the fen string if everything is a success */ |
| 294 gamestate->fen_start = strdup(fen_start); |
294 gamestate->fen_start = strdup(fen_start); |
| |
295 |
| |
296 /* check if the FEN describes an already ended game */ |
| |
297 if (check_checkmate(gamestate)) { |
| |
298 gamestate->checkmate = true; |
| |
299 } else if (check_no_material(gamestate)) { |
| |
300 gamestate->nomaterial = true; |
| |
301 } else if (check_threefold_repetition(gamestate)) { |
| |
302 gamestate->threefold = true; |
| |
303 } else if (check_stalemate(gamestate)) { |
| |
304 gamestate->stalemate = true; |
| |
305 } |
| |
306 |
| 295 return 0; |
307 return 0; |
| 296 } |
308 } |