+ // Evaluate the position statically
+ isCheck = pos.is_check();
+ EvalInfo ei;
+ if (!isCheck)
+ {
+ ss[ply].eval = evaluate(pos, ei, threadID);
+
+ // Store gain statistics
+ Move m = ss[ply - 1].currentMove;
+ if ( m != MOVE_NULL
+ && pos.captured_piece() == NO_PIECE_TYPE
+ && !move_is_castle(m)
+ && !move_is_promotion(m))
+ MG.store(pos.piece_on(move_to(m)), move_from(m), move_to(m), ss[ply - 1].eval, -ss[ply].eval);
+
+ }
+