// If running in analysis mode, make sure we use symmetrical king safety. We do this
// by replacing both Weights[kingDangerUs] and Weights[kingDangerThem] by their average.
- if (Options["UCI_AnalyseMode"].value<bool>())
+ if (Options["UCI_AnalyseMode"])
Weights[kingDangerUs] = Weights[kingDangerThem] = (Weights[kingDangerUs] + Weights[kingDangerThem]) / 2;
init_safety();
if (bonus && bit_is_set(ei.attackedBy[Us][PAWN], s))
{
if ( !pos.pieces(KNIGHT, Them)
- && !(SquaresByColorBB[color_of(s)] & pos.pieces(BISHOP, Them)))
+ && !(same_color_squares(s) & pos.pieces(BISHOP, Them)))
bonus += bonus + bonus / 2;
else
bonus += bonus / 2;
Score weight_option(const std::string& mgOpt, const std::string& egOpt, Score internalWeight) {
// Scale option value from 100 to 256
- int mg = Options[mgOpt].value<int>() * 256 / 100;
- int eg = Options[egOpt].value<int>() * 256 / 100;
+ int mg = Options[mgOpt] * 256 / 100;
+ int eg = Options[egOpt] * 256 / 100;
return apply_weight(make_score(mg, eg), internalWeight);
}