git.haldean.org grandmaster / 8e12cb9
add check and checkmate to algebraic when missing haldean 6 months ago
1 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
272272 size_t capture_index; /* only set if is_capture */
273273 size_t input_len;
274274 size_t disambig_len;
275 char *tmp;
275276 struct move *result;
276277 struct piece piece;
277278 int i;
479480 result->post_board->termination = VICTORY_WHITE;
480481 else
481482 result->post_board->termination = VICTORY_BLACK;
483 if (result->algebraic[input_len - 1] != '#')
484 {
485 tmp = result->algebraic;
486 asprintf(&result->algebraic, "%s#", tmp);
487 free(tmp);
488 }
482489 }
483490 else if (in_stalemate(result, opposite(result->player)))
484491 {
485492 result->post_board->termination = STALEMATE;
493 }
494 else if (in_check(result, opposite(result->player)))
495 {
496 if (result->algebraic[input_len - 1] != '+')
497 {
498 tmp = result->algebraic;
499 asprintf(&result->algebraic, "%s+", tmp);
500 free(tmp);
501 }
486502 }
487503 result->post_board->draws = DRAW_NONE;
488504