case PH_GOOD_CAPTURES:
lastMove = generate_captures(pos, moves);
score_captures();
- std::sort(moves, lastMove);
+ std::stable_sort(moves, lastMove);
return;
case PH_KILLERS:
case PH_NONCAPTURES:
lastMove = generate_noncaptures(pos, moves);
score_noncaptures();
- std::sort(moves, lastMove);
+ std::stable_sort(moves, lastMove);
return;
case PH_BAD_CAPTURES:
// to get SEE move ordering.
curMove = badCaptures;
lastMove = lastBadCapture;
- std::sort(badCaptures, lastMove);
+ std::stable_sort(badCaptures, lastMove);
return;
case PH_EVASIONS:
assert(pos.is_check());
lastMove = generate_evasions(pos, moves, pinned);
score_evasions();
- std::sort(moves, lastMove);
+ std::stable_sort(moves, lastMove);
return;
case PH_QCAPTURES:
lastMove = generate_captures(pos, moves);
score_captures();
- std::sort(moves, lastMove);
+ std::stable_sort(moves, lastMove);
return;
case PH_QCHECKS: