Skip to content

Commit

Permalink
Fix bug in CTG probing logic where the move list is empty after filte…
Browse files Browse the repository at this point in the history
…ring out all unwanted/bad moves
  • Loading branch information
khalid-a-omar committed Oct 1, 2023
1 parent a19a5e3 commit 9ba0d72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/book/ctg/ctg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,10 @@ namespace Polyfish::Book::CTG
}),
ctgMoveList.end());

//Check move list again after removing unwanted moves
if (ctgMoveList.size() == 0)
return MOVE_NONE;

//Sort moves accorging to their weights
stable_sort(ctgMoveList.begin(), ctgMoveList.end(), [](const CtgMove& mv1, const CtgMove& mv2) { return mv1.weight() > mv2.weight(); });

Expand Down

0 comments on commit 9ba0d72

Please sign in to comment.