Merge pull request #18 from rektdie/ordering_fix
fixed move ordering | bench 2105742
This commit was merged in pull request #18.
This commit is contained in:
1 file changed
+7
-5
+7
-5
@@ -20,17 +20,19 @@ inline PVLine pvLine;
|
|||||||
Stopwatch sw;
|
Stopwatch sw;
|
||||||
|
|
||||||
static int ScoreMove(Board &board, Move &move) {
|
static int ScoreMove(Board &board, Move &move) {
|
||||||
const int attackerType = board.GetPieceType(move.MoveFrom());
|
|
||||||
const int targetType = board.GetPieceType(move.MoveTo());
|
|
||||||
|
|
||||||
if (attackerType == nullPieceType || targetType == nullPieceType) return 0;
|
|
||||||
|
|
||||||
TTEntry *current = TT.GetRawEntry(board.hashKey);
|
TTEntry *current = TT.GetRawEntry(board.hashKey);
|
||||||
if (current->bestMove == move) {
|
if (current->bestMove == move) {
|
||||||
return 50000;
|
return 50000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (move.IsCapture()) {
|
if (move.IsCapture()) {
|
||||||
|
const int attackerType = board.GetPieceType(move.MoveFrom());
|
||||||
|
int targetType = board.GetPieceType(move.MoveTo());
|
||||||
|
|
||||||
|
if (move.GetFlags() == epCapture) {
|
||||||
|
targetType = Pawn;
|
||||||
|
}
|
||||||
|
|
||||||
return moveScoreTable[attackerType][targetType] + 10000;
|
return moveScoreTable[attackerType][targetType] + 10000;
|
||||||
} else {
|
} else {
|
||||||
if (killerMoves[0][ply] == move) {
|
if (killerMoves[0][ply] == move) {
|
||||||
|
|||||||
Reference in new issue
Block a user