Fix pseudo-legal move validation for horde chess
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 3 Aug 2019 18:31:30 +0000 (20:31 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 3 Aug 2019 20:46:52 +0000 (22:46 +0200)
horde STC
LLR: 2.95 (-2.94,2.94) [-10.00,5.00]
Total: 478 W: 268 L: 204 D: 6
http://35.161.250.236:6543/tests/view/5d45d3aa6e23db34f4206d3d

src/position.cpp

index 1111530..aee2cc9 100644 (file)
@@ -888,7 +888,8 @@ bool Position::pseudo_legal(const Move m) const {
       if (   !(attacks_from<PAWN>(us, from) & pieces(~us) & to) // Not a capture
           && !((from + pawn_push(us) == to) && empty(to))       // Not a single push
           && !(   (from + 2 * pawn_push(us) == to)              // Not a double push
-               && (rank_of(from) == relative_rank(us, RANK_2))
+               && (rank_of(from) == relative_rank(us, RANK_2)
+                   || (first_rank_double_steps() && rank_of(from) == relative_rank(us, RANK_1)))
                && empty(to)
                && empty(to - pawn_push(us))
                && double_step_enabled()))