- // Do we have to play with skill handicap? In this case enable MultiPV that
- // we will use behind the scenes to retrieve a set of possible moves.
- MultiPV = skill.enabled() ? std::max(UCIMultiPV, (size_t)4) : UCIMultiPV;
+ // Do we have to play with skill handicap? In this case enable MultiPV search
+ // that we will use behind the scenes to retrieve a set of possible moves.
+ if (skill.enabled() && PVSize < 4)
+ PVSize = 4;
+
+ PVSize = std::min(PVSize, RootMoves.size());