const Score WeightKingOppSafetyInternal = make_score(259, 0);
// Mobility and outposts bonus modified by Joona Kiiski
- //
- // Visually better to define tables constants
+
typedef Value V;
#define S(mg, eg) make_score(mg, eg)
// Probe the pawn hash table
ei.pi = PawnTable[threadID]->get_pawn_info(pos);
- ei.value += apply_weight(ei.pi->value(), WeightPawnStructure);
+ ei.value += apply_weight(ei.pi->pawns_value(), WeightPawnStructure);
// Initialize king attack bitboards and king attack zones for both sides
ei.attackedBy[WHITE][KING] = pos.attacks_from<KING>(pos.king_square(WHITE));
if (ei.pi->passed_pawns())
evaluate_passed_pawns(pos, ei);
- Phase phase = pos.game_phase();
+ Phase phase = ei.mi->game_phase();
// Middle-game specific evaluation terms
if (phase > PHASE_ENDGAME)
assert(pos.is_ok());
- static const
- ScaleFactor sf[2] = {SCALE_FACTOR_NORMAL, SCALE_FACTOR_NORMAL};
-
- Phase ph = pos.game_phase();
- Color stm = pos.side_to_move();
+ static const ScaleFactor sf[2] = {SCALE_FACTOR_NORMAL, SCALE_FACTOR_NORMAL};
- return Sign[stm] * scale_by_game_phase(pos.value(), ph, sf);
+ Value v = scale_by_game_phase(pos.value(), MaterialInfoTable::game_phase(pos), sf);
+ return (pos.side_to_move() == WHITE ? v : -v);
}