projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
6900756
)
Set castling rights only if enabled
author
Fabian Fichter
<ianfab@users.noreply.github.com>
Mon, 14 Oct 2019 16:24:27 +0000 (18:24 +0200)
committer
Fabian Fichter
<ianfab@users.noreply.github.com>
Mon, 14 Oct 2019 16:24:27 +0000 (18:24 +0200)
Makes FEN parsing more robust and allows to support S-Chess without castling.
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
9f3351e
..
0462ff3
100644
(file)
--- a/
src/position.cpp
+++ b/
src/position.cpp
@@
-384,11
+384,12
@@
Position& Position::set(const Variant* v, const string& fenStr, bool isChess960,
continue;
}
- set_castling_right(c, rsq);
+ if (castling_enabled())
+ set_castling_right(c, rsq);
}
// Set castling rights for 960 gating variants
- if (gating())
+ if (gating() && castling_enabled())
for (Color c : {WHITE, BLACK})
if ((gates(c) & pieces(KING)) && !castling_rights(c) && (count_in_hand(c, ALL_PIECES) || captures_to_hand()))
{