if (m == MOVE_NULL)
return "(null)";
- if (move_is_long_castle(m) || (int(to - from) == -2 && pt == KING))
+ if (move_is_long_castle(m))
san = "O-O-O";
- else if (move_is_short_castle(m) || (int(to - from) == 2 && pt == KING))
+ else if (move_is_short_castle(m))
san = "O-O";
else
{
int matches, state = START;
// Generate all legal moves for the given position
- last = generate_moves(pos, mlist);
+ last = generate<MV_LEGAL>(pos, mlist);
// Castling moves
if (movestr == "O-O-O" || movestr == "O-O-O+")
return AMBIGUITY_NONE;
// Collect all legal moves of piece 'pc' with destination 'to'
- last = generate_moves(pos, mlist);
+ last = generate<MV_LEGAL>(pos, mlist);
for (MoveStack* cur = mlist; cur != last; cur++)
if (move_to(cur->move) == to && pos.piece_on(move_from(cur->move)) == pc)
candidates[matches++] = cur->move;