Retire is_mate()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-01-10 11:57:06 +01:00
parent bede30e7a6
commit c19ea4b000
3 changed files with 10 additions and 24 deletions

View File

@@ -147,13 +147,13 @@ const string move_to_san(Position& pos, Move m) {
}
}
// The move gives check? We don't use pos.move_gives_check() here
// because we need to test for a mate after the move is done.
StateInfo st;
pos.do_move(m, st);
if (pos.in_check())
san += pos.is_mate() ? "#" : "+";
pos.undo_move(m);
if (pos.move_gives_check(m, CheckInfo(pos)))
{
StateInfo st;
pos.do_move(m, st);
san += MoveList<MV_LEGAL>(pos).size() ? "+" : "#";
pos.undo_move(m);
}
return san;
}