diff --git a/src/position.h b/src/position.h index 5c2374f2..e77cb00f 100644 --- a/src/position.h +++ b/src/position.h @@ -273,7 +273,8 @@ inline Key Position::key() const { return adjust_key60(st->key); } template inline Key Position::adjust_key60(Key k) const { - return st->rule60 < 14 - AfterMove ? k : k ^ make_key((st->rule60 - (14 - AfterMove)) / 8); + return (st->rule60 < 14 - AfterMove ? k : k ^ make_key((st->rule60 - (14 - AfterMove)) / 8)) + ^ (filter[st->key] ? make_key(14) : 0); } inline Key Position::pawn_key() const { return st->pawnKey; }