- // Collect all legal moves of piece type 'pt' with destination 'to'
- MoveStack* last = generate<MV_LEGAL>(pos, mlist);
- int f = 0, r = 0, cnt = 0;
+ // Disambiguation if we have more then one piece with destination 'to'
+ // note that for pawns is not needed because starting file is explicit.
+ attackers = pos.attackers_to(to) & pos.pieces(pt, pos.side_to_move());
+ clear_bit(&attackers, from);
+ ambiguousMove = ambiguousFile = ambiguousRank = false;